HMM存在三个基本问题:
问题1和问题3可以通过sklearn HMM tutorial解决。但是我们如何使用sklearn来解决问题2?
答案 0 :(得分:2)
使用score()函数。从代码:
def score(self, X, lengths=None):
"""Compute the log probability under the model.
Parameters
----------
X : array-like, shape (n_samples, n_features)
Feature matrix of individual samples.
lengths : array-like of integers, shape (n_sequences, ), optional
Lengths of the individual sequences in ``X``. The sum of
these should be ``n_samples``.
Returns
-------
logprob : float
Log likelihood of ``X``.