prnicolas / ScalaMl

Project, source code and data files for 1st edition "Scala for Machine Learning"
http://www.scalaformachinelearning.com
151 stars 86 forks source link

Sum of rows in A, B and Pi are not equal 1 in Unit tests for HMM #3

Open dn2015 opened 9 years ago

dn2015 commented 9 years ago

The unit test #2 (training) for HMM for chapter 7 outputs State Transition probs A, Emission probs B and Initial probs pi:

***\ test#2 HMMEval Hidden Markov Model - Training HMMEval (Training): State transition probs A 0.137, 0.229, 0.495, 0.282, 0.081 0.236, 0.031, 0.756, 0.947, 0.898 0.225, 0.343, 0.567, 0.096, 0.217 1.000, 0.045, 0.640, 0.046, 0.059 0.000, 0.080, 0.715, 0.309, 0.162

Emission probs B 0.311, 0.487, 0.114, 0.127, 0.068, 0.163 0.003, 0.224, 0.000, 0.044, 1.000, 0.000 0.100, 0.375, 0.150, 0.240, 0.210, 0.196 0.086, 0.615, 0.015, 0.252, 0.282, 0.020 0.304, 0.410, 0.115, 0.182, 0.068, 0.190

Initial probs pi 1.000 0.069 0.522 0.000 0.043

My understanding is the sum of the values in each rows of these matrices need to be 1.0. But they don't seem to be in the output of test#2. Could you shed some light on that?

Thanks.

leowu4ever commented 8 years ago

I am not using this lib but I come across the same issue. Could you please help me on this?