本文整理汇总了Python中hmmlearn.hmm.GaussianHMM.startprob_prior方法的典型用法代码示例。如果您正苦于以下问题:Python GaussianHMM.startprob_prior方法的具体用法?Python GaussianHMM.startprob_prior怎么用?Python GaussianHMM.startprob_prior使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hmmlearn.hmm.GaussianHMM
的用法示例。
在下文中一共展示了GaussianHMM.startprob_prior方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: scale
# 需要导入模块: from hmmlearn.hmm import GaussianHMM [as 别名]
# 或者: from hmmlearn.hmm.GaussianHMM import startprob_prior [as 别名]
if analysis is not None:
try:
obs = numpy.array(analysis)
obs = obs.T
obs = obs[1:]
obs = obs.T
obs = scale(obs)
model = GaussianHMM(algorithm='viterbi', covariance_type='diag', covars_prior=0.01,
covars_weight=1, init_params='mc', means_prior=0, means_weight=0,
min_covar=0.001, n_components=3, n_iter=1000, params='mc',
random_state=None, startprob_prior=1.0, tol=0.01, transmat_prior=1.0,
verbose=False)
model.startprob_ = numpy.array([1., 0, 0])
model.startprob_prior = model.startprob_
model.transmat_ = numpy.array([[0.9, 0.1, 0], [0, 0.9, 0.1], [0, 0, 1]])
model.transmat_prior = model.transmat_
model.fit(obs)
pi = model.startprob_
A = model.transmat_
w = numpy.ones((n, m), dtype=numpy.double)
hmm_means = numpy.ones((n, m, d), dtype=numpy.double)
hmm_means[0][0] = model.means_[0]
hmm_means[1][0] = model.means_[1]
hmm_means[2][0] = model.means_[2]
hmm_covars = numpy.array([[ numpy.matrix(numpy.eye(d,d)) for j in xrange(m)] for i in xrange(n)])
hmm_covars[0][0] = model.covars_[0]
hmm_covars[1][0] = model.covars_[1]