|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.classifier.sequencelearning.hmm.HmmAlgorithms
public final class HmmAlgorithms
Class containing implementations of the three major HMM algorithms: forward, backward and Viterbi
Method Summary | |
---|---|
static Matrix |
backwardAlgorithm(HmmModel model,
int[] observations,
boolean scaled)
External function to compute a matrix of beta factors |
static Matrix |
forwardAlgorithm(HmmModel model,
int[] observations,
boolean scaled)
External function to compute a matrix of alpha factors |
static int[] |
viterbiAlgorithm(HmmModel model,
int[] observations,
boolean scaled)
Viterbi algorithm to compute the most likely hidden sequence for a given model and observed sequence |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Matrix forwardAlgorithm(HmmModel model, int[] observations, boolean scaled)
model
- model to run forward algorithm for.observations
- observation sequence to train on.scaled
- Should log-scaled beta factors be computed?
public static Matrix backwardAlgorithm(HmmModel model, int[] observations, boolean scaled)
model
- model to use for estimation.observations
- observation sequence seen.scaled
- Set to true if log-scaled beta factors should be computed.
public static int[] viterbiAlgorithm(HmmModel model, int[] observations, boolean scaled)
model
- HmmModel for which the Viterbi path should be computedobservations
- Sequence of observationsscaled
- Use log-scaled computations, this requires higher computational
effort but is numerically more stable for large observation
sequences
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |