The Hidden Markov model (Hidden Markov MODEL,HMM) is a statistical model of probability, which is used to describe a Markov process with hidden unknown parameters. The difficulty is to determine the implicit parameters of the procedure from observable parameters.
Hmm normal is mainly used to solve three kinds of problems, the corresponding three types of problems are related to the algorithm. Evaluation PROBLEM: Forward algorithm * * decoding PROBLEM: Viterbi algorithm * * Learning problem: Baum-welch algorithm (forward backward algorithm)
Mahout actually actually supported these algorithms, so the next experiment.
(1) test according to the example given by Mahout official documentation. (https://mahout.apache.org/users/classification/hidden-markov-models.html
First define an input:
$ echo "0 1 2 2 2 1 1 0 0 3 3 3 2 1 2 1 1 1 1 2 2 2 0 0 0 0 0 0 2 2 2 0 0 0 0 0 0 2 2 2 3 3 3 3 3 3 2 3 2 3 0 0 0 1 0 1 0 2 1 2 1 2 1 2 3 3 3 3 2 2 3 2 1 1 0 "> Hmm-input
Then test the Baum-welch algorithm.
$ export mahout_local=true
$ $MAHOUT _home/bin/mahout baumwelch-i hmm-input-o hmm-model-nh 3-no 4-e. 0001-M 1000
Finally return the predicted result value:
$ $MAHOUT _home/bin/mahout hmmpredict-m Hmm-model-o hmm-predictions-l 10
Easy test success, done. The result is as shown in the figure.
(2) The example of part-of-speech judgment in the mahout example is verified, and the result is as shown in the figure: