accord-net / framework

Machine learning, computer vision, statistics and general scientific computing for .NET
http://accord-framework.net
GNU Lesser General Public License v2.1
4.46k stars 2k forks source link

Add an Example for BaumWelchLearning(TDistribution, TObservation) Class #2175

Open retiutut opened 3 years ago

retiutut commented 3 years ago

Please add an example for BaumWelchLearning(TDistribution, TObservation) Class.

TODO (optional): Describe a specific scenario you would like to see addressed.

Help Topic: http://accord-framework.net/docs/html/T_Accord_Statistics_Models_Markov_Learning_BaumWelchLearning_2.htm

        // Creates a new Hidden Markov Model Classifier with the given parameters
        HiddenMarkovClassifier classifier = new HiddenMarkovClassifier(classes, states, symbols);

        // Create a new learning algorithm to train the sequence classifier
        var teacher = new HiddenMarkovClassifierLearning(classifier,

            // Train each model until the log-likelihood changes less than 0.001
            modelIndex => new BaumWelchLearning(classifier.Models[modelIndex])
            {
                Tolerance = 0.001,
                MaxIterations = 1000
            }
        );

Is failing on new BaumWelchLearning(classifier.Models[modelIndex]) in Unity with Accord 3.8.0.