Hidden Markov Model (HMM) Training

>>> from mlpack import hmm_train

This program allows a Hidden Markov Model to be trained on labeled or unlabeled data. It support three types of HMMs: discrete HMMs, Gaussian HMMs, or GMM HMMs.

Either one input sequence can be specified (with --input_file), or, a file containing files in which input sequences can be found (when --input_file and --batch are used together). In addition, labels can be provided in the file specified by --labels_file, and if --batch is used, the file given to --labels_file should contain a list of files of labels corresponding to the sequences in the file given to --input_file.

The HMM is trained with the Baum-Welch algorithm if no labels are provided. The tolerance of the Baum-Welch algorithm can be set with the --tolerance option. By default, the transition matrix is randomly initialized and the emission distributions are initialized to fit the extent of the data.

Optionally, a pre-created HMM model can be used as a guess for the transition matrix and emission probabilities; this is specifiable with --model_file.

input options

output options

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