---
name: "mlpack_hmm_train"
section: "1"
platform: "linux"
package: "mlpack-bin"
version: "4.6.0-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_hmm_train"
---

# mlpack\_hmm\_train(1)

hidden markov model (hmm) training

## NAME

**mlpack\_hmm\_train** - hidden markov model (hmm) training

## SYNOPSIS

```
 mlpack_hmm_train -i string [-b bool] [-g int] [-m unknown] [-l string] [-s int] [-n int] [-T double] [-t string] [-V bool] [-M unknown] [-h -v]
```

## DESCRIPTION

This program allows a Hidden Markov Model to be trained on labeled or unlabeled data. It supports four types of HMMs: Discrete HMMs, Gaussian HMMs, GMM HMMs, or Diagonal GMM HMMs

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

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** (**-T**)'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 ’**--output\_model\_file** (**-M**)'.

## REQUIRED INPUT OPTIONS

- **--input\_file (-i) \[*string*\]**

  File containing input observations.

## OPTIONAL INPUT OPTIONS

- **--batch (-b) \[*bool*\]**

  If true, input\_file (and if passed, labels\_file) are expected to contain a list of files to use as input observation sequences (and label sequences).

- **--gaussians (-g) \[*int*\]**

  Number of gaussians in each GMM (necessary when type is 'gmm'). Default value 0.

- **--help (-h) \[*bool*\]**

  Default help info.

- **--info \[*string*\]**

  Print help on a specific option. Default value ''.

- **--input\_model\_file (-m) \[*unknown*\]**

  Pre-existing HMM model to initialize training with.

- **--labels\_file (-l) \[*string*\]**

  Optional file of hidden states, used for labeled training. Default value ''.

- **--seed (-s) \[*int*\]**

  Random seed. If 0, 'std::time(NULL)' is used.  Default value 0.

- **--states (-n) \[*int*\]**

  Number of hidden states in HMM (necessary, unless model\_file is specified). Default value 0.

- **--tolerance (-T) \[*double*\]**

  Tolerance of the Baum-Welch algorithm. Default value 1e-05.

- **--type (-t) \[*string*\]**

  Type of HMM: discrete \| gaussian \| diag\_gmm \| gmm. Default value 'gaussian'.

- **--verbose (-v) \[*bool*\]**

  Display informational messages and the full list of parameters and timers at the end of execution.

- **--version (-V) \[*bool*\]**

  Display the version of mlpack.

## OPTIONAL OUTPUT OPTIONS

- **--output\_model\_file (-M) \[*unknown*\]**

  Output for trained HMM.

## ADDITIONAL INFORMATION

For further information, including relevant papers, citations, and theory, consult the documentation found at http://www.mlpack.org or included with your distribution of mlpack.
