The N-Gram predictor can be improved by having a handler with several other predictors ranging from 1 to n, and obtaining the best possible action after comparing the best guess from each one of them.
Improving the predictor – Hierarchical N-Gram
Getting ready...
We need to make some adjustments prior to implementing the hierarchical N-Gram predictor.
Add the following member function to the NGramPredictor class:
public int GetActionsNum(ref T[] actions) { string key = ArrToStrKey(ref actions); if (!data.ContainsKey(key)) return 0; return data[key].total; }