title: How to solve basic HMM problems with hmmlearn
body: <p>There are three fundamental HMM problems:</p>
  
  <blockquote>
    <p>Problem 1 (Likelihood): Given an HMM λ = (A,B) and an observation
    sequence O, determine the likelihood P(O|λ).</p>
    
    <p>Problem 2 (Decoding): Given an observation sequence O and an HMM λ =
    (A,B), discover the best hidden state sequence Q.</p>
    
    <p>Problem 3 (Learning): Given an observation sequence O and the set of
    states in the HMM, learn the HMM parameters A and B.</p>
  </blockquote>
  
  <p>I'm interested in Problems ## 1 and 3. In general, first problem can be solved with Forward Algorithm and third problem can be solved with Baum-Welch Algorithm. Am I right that I should use <code>fit(X, lengths)</code> and <code>score(X, lengths)</code> methods from hmmlearn for solving first and third problems respectively? (The documentation does not say that <code>score</code> uses Forward Algorithm.)</p>
  
  <p>And I have some more questions about <code>score</code> method. Why <code>score</code> calculates <strong>log</strong> probability? And why if I pass several sequences to <code>score</code> it returns sum of log probabilities instead of probability for each sequence?</p>
  
  <p>My original task was the following: I have 1 million short sentences of equal size (10 words). I want to train HMM model with that data and for test data (10-words sentences again) predict the probability of each sentence in the model. And based on that probability I will decide is that usual or unusual phrase.</p>
  
  <p>And maybe there is better libraries for python to solve that problems?</p>