mlpack.hmm_generate

hmm_generate(...)
Hidden Markov Model (HMM) Sequence Generator

>>> from mlpack import hmm_generate

This utility takes an already-trained HMM, specified as the 'model' parameter, and generates a random observation sequence and hidden state sequence based on its parameters. The observation sequence may be saved with the 'output' output parameter, and the internal state sequence may be saved with the 'state' output parameter.

The state to start the sequence in may be specified with the 'start_state' parameter.

For example, to generate a sequence of length 150 from the HMM 'hmm' and save the observation sequence to 'observations' and the hidden state sequence to 'states', the following command may be used:

>>> output = hmm_generate(model=hmm, length=150)
>>> observations = output['output']
>>> states = output['state']

input options

output options

The return value from the binding is a dict containing the following elements: