Here are the links to two blog posts of mine discussing the application of n-gram models to
-
text generation
http://mathematicaforprediction.wordpress.com/2014/01/25/markov-chains-n-gram-model-implementation/ , -
genome data classification
http://mathematicaforprediction.wordpress.com/2014/01/27/classification-of-genome-data-with-n-gram-models/ .
The second post has a discussion about using a modified Receiver Operating Characteristic (ROC) to select the best n of the n-gram models for different combinations of gene pairs.
Here is an example of ROC plots:
I plan to update this post with the Mathematica code I programmed and used. That code can be also found in https://github.com/antononcube/MathematicaForPrediction (MathematicForPrediction at GitHub). The full blown article describing the genome data classification algorithm and experiments can be downloaded from this link : https://github.com/antononcube/MathematicaForPrediction/blob/master/Documentation/Classification%20of%20genome%20data%20with%20n-gram%20models.pdf

