0

我已经使用 jahmm 为草图“D”训练了一个 hmm 模型,该模型是按照 jahmm 网站的建议通过 K-means 初始化的,然后我使用 Baum-Welch 算法。经过训练,我测试了一个观察序列,通过 ForwardBackwardScaledCalculator.InProbability() 方法得到概率,代码是;

... //training KMeansLearner<ObservationInteger> kml = new KMeansLearner<ObservationInteger>(20, new OpdfIntegerFactory(256), seqs); KullbackLeiblerDistanceCalculator klc = new KullbackLeiblerDistanceCalculator(); Hmm initHmm = kml.learn(); BaumWelchLearner bwl = new BaumWelchLearner(); Hmm<ObservationInteger> learntHmm = bwl.iterate(initHmm, seqs); for (int i = 0; i < 10; i++) { System.out.println("Distance at iteration : " + klc.distance(learntHmm, initHmm)); learntHmm = bwl.iterate(learntHmm, seqs); } return learntHmm //test ForwardBackwardScaledCalculator fbc = new ForwardBackwardScaledCalculator(testseqs,trainedHmm); System.out.println(fbc.lnProbability());

但是,lnProbability() 的结果就像 -196.25146 甚至更小(-300),这里有什么问题?是因为 HMm 没有训练好还是因为数据集?非常感谢任何建议!

4

1 回答 1

2

it has been a long time since you asked but since I have also used the same library with a similar way, let me try to answer your question.

The thing with Hmms is that the recognition probability is dependable to the size of the dataset and the larger the dataset the less the probability of recognition will be. You could try to set your recognition threshold with regards to the dataset size, or by getting an average value of the recognition probability of same accurate representations of your model.

于 2015-07-22T00:41:41.503 回答