# Which data mining or machine learning algorithm would be appropriate for learning ordered frequent patterns?

I have a dataset as (var1, var2, out), where the ordered pair <var1, var2> gives out. Most of the frequent pattern mining algorithms like the Apriori and FP growth algorithms do not preserve the order of var1 and var2.

Which are some of the available pattern mining algorithms (maybe also a NN trick), to find association rules between ordered pair <var1, var2> and output variable out?

• What about KNN? Nov 13, 2018 at 18:28
• Can you please describe more on the suggested approach? As it is a big data problem, not sure what would be a reasonable value for k in KNN. Nov 13, 2018 at 18:32
• Maybe KNN is not the best choice if you deal with Big Data. What is the distributions of your features and outcomes? Nov 13, 2018 at 21:57
• in general pattern analysis is done with Markov models and also based on data, industry also algorithm changes Nov 14, 2018 at 14:46
• Can you give us more information? You have only two input variables? Or the variables are sets? The outcome is discrete? Nov 15, 2018 at 6:09

Assuming you only have these two features (var1, var2), you might want to: * Create one-hot encoded features for each variable under each position. * Add a column on which variable is first (e.g. two columns - likely to work with trees but not with anything else). * Take each possible combination of variables and use that as your only input (e.g. you then take the average of out for that combination, perhaps adding some prior or smoothing).
As the comments mentioned, if out is some discrete event, maybe you'd want to instead look at Markov models.