<p>Hi Davud,</p>

<p>You are right that there is no HMM tutorial.  I'd like to write one at some point, but I haven't had the time.  If you are using the command-line interface, you have four programs available to you: <code>hmm_generate</code>, <code>hmm_loglik</code>, <code>hmm_train</code>, and <code>hmm_viterbi</code>.  You can use <code>--help</code> with each of these programs to get some information on what they do and how to use them.  Another place you could look, if you are writing C++ (which I think you may need to do for what you're trying to do) is in the tests: the file <code>src/mlpack/tests/hmm_test.cpp</code> may be helpful, for example.  The Doxygen documentation for the <code>HMM</code> class could also be useful: <a href="http://mlpack.org/docs/mlpack-git/doxygen.php?doc=classmlpack_1_1hmm_1_1HMM.html#details">http://mlpack.org/docs/mlpack-git/doxygen.php?doc=classmlpack_1_1hmm_1_1HMM.html#details</a></p>

<blockquote>
<p>How can I prepare an "already-trained" hmm?</p>
</blockquote>

<p>In C++, assuming you have the transition matrix and emission distribution information, you can set the transition matrix with <code>HMM::Transition()</code> (i.e. <code>hmm.Transition() = myTransitionMatrix</code>), and then you can set the emission distributions individually.  You mentioned using GMM-HMMs, so if you call <code>hmm.Emission(0)</code> you get back a <code>GMM</code> object, which will have weights, means, and variances that you can set individually; see <a href="http://mlpack.org/docs/mlpack-git/doxygen.php?doc=classmlpack_1_1gmm_1_1GMM.html#details">http://mlpack.org/docs/mlpack-git/doxygen.php?doc=classmlpack_1_1gmm_1_1GMM.html#details</a> for more information.</p>

<p>If you are trying to use the command-line, there isn't any support for that, so you would have to manually write the model file by hand... (more on that in a moment)</p>

<blockquote>
<p>How can I connect labels with emissions/observations?</p>
</blockquote>

<p>I don't know what you mean.  If you use <code>hmm_train</code>, you pass in a sequence of observations with <code>--input_file</code> and their corresponding labels to <code>--labels_file</code>.  If you use C++, the API documentation should make this clear.</p>

<blockquote>
<p>How does a label-file/model-file/observation-file look like?</p>
</blockquote>

<p>For label and observation files, mlpack supports many input file types, but the simplest will just be csv; one observation/label per line.  See mlpack.org/docs/mlpack-git/doxygen.php?doc=namespacemlpack_1_1data.html#ac3dd73bcdb8c2d990a3bb1aafe65af23 for more information.</p>

<p>For model files, boost::serialization is used, which currently can output models in xml, binary, or text (depending on the filename suffix you use).</p>

<p>I hope this is helpful.  Let me know if I can clarify anything.</p>

<p>Thanks,</p>

<p>Ryan</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/issues/470#issuecomment-156478968">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFGbrjp3ZOeGMM_kKpjANSW0_UzRUks5pFgZQgaJpZM4Gh38U.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/issues/470#issuecomment-156478968"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>