Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create a degenerate problem
- double[][] sequences = new double[][]
- {
- new double[] { 1,1,1,1,1,0,1,1,1,1 },
- new double[] { 1,1,1,1,0,1,1,1,1,1 },
- new double[] { 1,1,1,1,1,1,1,1,1,1 },
- new double[] { 1,1,1,1,1,1 },
- new double[] { 1,1,1,1,1,1,1 },
- new double[] { 1,1,1,1,1,1,1,1,1,1 },
- new double[] { 1,1,1,1,1,1,1,1,1,1 },
- };
- // Creates a continuous hidden Markov Model with two states organized in a ergodic
- // topology and an underlying multivariate Normal distribution as density.
- var density = new Accord.Statistics.Distributions.Multivariate.NormalDistribution(1);
- ContinuousHiddenMarkovModel model = new ContinuousHiddenMarkovModel(new Ergodic(2), density);
- // Configure the learning algorithms to train the sequence classifier
- ContinuousBaumWelchLearning teacher = new ContinuousBaumWelchLearning(model)
- {
- Tolerance = 0.0001,
- Iterations = 0,
- // Configure options for fitting the normal distribution
- FittingOptions = new NormalOptions() { Regularization = 0.0001, }
- };
- // Fit the model. No exceptions will be thrown
- double likelihood = teacher.Run(sequences);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement