Predicting actions is a great way to give players a challenge by going from random selection to selection based on past actions. One way to implement machine learning is by using probabilities to predict what the player will do next, and that's what an N-Gram predictor does.
To predict the player's next choice, N-Gram predictors hold a record of the probabilities of making particular decisions (which are usually moves), given all the combinations of the choices for the previous n moves.