Compact Prediction Tree

This is an implementation of CPT algorithm for Fast Sequence Prediction. Its written in Pure Javascript and can be run both in NodeJS and the browser.
The library is based on these research papers:
-
Compact Prediction Tree: A Losless Model for Accurate Sequence Prediction
-
CPT+: Decreasing the time/space complexity of the Compact Prediction Tree
Install
$ npm i compact-prediciton-tree
Usage
; let model = ;let data = 'hello' 'how' 'are' 'you' 'hello' 'how' 'are' 'your' 'studies' 'going' '?' 'This' 'is' 'a' 'test' 'How' 'does' 'this' 'work'model; let target = 'how' 'are';let predictions = model; console // [['you'], ['your']]
It works on Strings/Number sequences. Optimizations are pending such as compression of frequenct sequences. Pull requests are welcome!