Accord.Tests.Statistics.Models.Fields.MultivariateMarkovFunctionTest.CreateModel3 C# (CSharp) Method

CreateModel3() public static method

public static CreateModel3 ( int states = 4, bool priors = true ) : HiddenMarkovClassifier
states int
priors bool
return HiddenMarkovClassifier
        public static HiddenMarkovClassifier<MultivariateNormalDistribution> CreateModel3(
            int states = 4, bool priors = true)
        {

            MultivariateNormalDistribution density = new MultivariateNormalDistribution(2);

            var classifier = new HiddenMarkovClassifier<MultivariateNormalDistribution>(6,
                new Forward(states), density);

            string[] labels = { "1", "2", "3", "4", "5", "6" };
            for (int i = 0; i < classifier.Models.Length; i++)
                classifier.Models[i].Tag = labels[i];

            // Create the learning algorithm for the ensemble classifier
            var teacher = new HiddenMarkovClassifierLearning<MultivariateNormalDistribution>(classifier,

                // Train each model using the selected convergence criteria
                i => new BaumWelchLearning<MultivariateNormalDistribution>(classifier.Models[i])
                {
                    Tolerance = 0.1,
                    Iterations = 0,

                    FittingOptions = new NormalOptions() { Diagonal = true, Regularization = 1e-10 }
                }
            );

            teacher.Empirical = priors;

            // Run the learning algorithm
            teacher.Run(inputTest, outputTest);

            return classifier;
        }