Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides a simple way to train the transition matrix and initial probability vector using simple patterns of state sequences.
You may create a trained model using semigroup combinators like this:
let a = atom $ HMM.state 0 b = atom $ HMM.state 1 distr = Distr.DiscreteTrained $ Map.fromList $ ('a', Vector.fromList [1,2]) : ('b', Vector.fromList [4,3]) : ('c', Vector.fromList [0,1]) : [] in finish 2 distr $ replicate 5 $ replicate 10 a <> replicate 20 b