Example usage for org.apache.mahout.classifier.sequencelearning.hmm HmmTrainer trainBaumWelch

List of usage examples for org.apache.mahout.classifier.sequencelearning.hmm HmmTrainer trainBaumWelch

Introduction

In this page you can find the example usage for org.apache.mahout.classifier.sequencelearning.hmm HmmTrainer trainBaumWelch.

Prototype

public static HmmModel trainBaumWelch(HmmModel initialModel, int[] observedSequence, double epsilon,
        int maxIterations, boolean scaled) 

Source Link

Document

Iteratively train the parameters of the given initial model wrt the observed sequence using Baum-Welch training.

Usage

From source file:org.eclipse.tracecompass.internal.totalads.algorithms.hiddenmarkovmodel.HmmMahout.java

License:Open Source License

/**
 * Trains an HMM on a sequence using the BaumWelch algorithm
 *
 * @param numIterations/*from www  .j a  v a 2  s . c  om*/
 *            Number of Iterations
 * @param observedSequence
 *            The sequence
 */
public void learnUsingBaumWelch(Integer numIterations, Integer[] observedSequence) {

    int[] seq = new int[observedSequence.length];
    for (int i = 0; i < seq.length; i++) {
        seq[i] = observedSequence[i];
    }
    HmmTrainer.trainBaumWelch(fHmm, seq, 0.0001, numIterations, true);

}

From source file:org.eclipse.tracecompass.internal.totalads.algorithms.hiddenmarkovmodel.HmmMahout.java

License:Open Source License

/**
 * Trains an HMM on a sequence using the BaumWelch algorithm
 *
 * @param numIterations/*from  www  . j  a  v a2  s .c om*/
 *            Number of iterations
 * @param observedSequence
 *            The sequence
 */
public void learnUsingBaumWelch(Integer numIterations, int[] observedSequence) {

    HmmTrainer.trainBaumWelch(fHmm, observedSequence, 0.0001, numIterations, true);

}