本文整理汇总了Python中msmbuilder.msm.MarkovStateModel.score_ll方法的典型用法代码示例。如果您正苦于以下问题:Python MarkovStateModel.score_ll方法的具体用法?Python MarkovStateModel.score_ll怎么用?Python MarkovStateModel.score_ll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msmbuilder.msm.MarkovStateModel
的用法示例。
在下文中一共展示了MarkovStateModel.score_ll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_6
# 需要导入模块: from msmbuilder.msm import MarkovStateModel [as 别名]
# 或者: from msmbuilder.msm.MarkovStateModel import score_ll [as 别名]
def test_6():
# test score_ll with novel entries
model = MarkovStateModel(reversible_type='mle')
sequence = ['a', 'a', 'b', 'b', 'a', 'a', 'b', 'b']
model.fit([sequence])
assert not np.isfinite(model.score_ll([['c']]))
assert not np.isfinite(model.score_ll([['c', 'c']]))
assert not np.isfinite(model.score_ll([['a', 'c']]))
示例2: test_51
# 需要导入模块: from msmbuilder.msm import MarkovStateModel [as 别名]
# 或者: from msmbuilder.msm.MarkovStateModel import score_ll [as 别名]
def test_51():
# test score_ll
model = MarkovStateModel(reversible_type='mle')
sequence = ['a', 'a', 'b', 'b', 'a', 'a', 'b', 'b', 'c', 'c', 'c', 'a', 'a']
model.fit([sequence])
assert model.mapping_ == {'a': 0, 'b': 1, 'c': 2}
score_ac = model.score_ll([['a', 'c']])
assert score_ac == np.log(model.transmat_[0, 2])
示例3: test_score_ll_1
# 需要导入模块: from msmbuilder.msm import MarkovStateModel [as 别名]
# 或者: from msmbuilder.msm.MarkovStateModel import score_ll [as 别名]
def test_score_ll_1():
model = MarkovStateModel(reversible_type='mle')
sequence = ['a', 'a', 'b', 'b', 'a', 'a', 'b', 'b']
model.fit([sequence])
assert model.mapping_ == {'a': 0, 'b': 1}
score_aa = model.score_ll([['a', 'a']])
assert score_aa == np.log(model.transmat_[0, 0])
score_bb = model.score_ll([['b', 'b']])
assert score_bb == np.log(model.transmat_[1, 1])
score_ab = model.score_ll([['a', 'b']])
assert score_ab == np.log(model.transmat_[0, 1])
score_abb = model.score_ll([['a', 'b', 'b']])
assert score_abb == (np.log(model.transmat_[0, 1]) +
np.log(model.transmat_[1, 1]))
assert model.state_labels_ == ['a', 'b']
assert np.sum(model.populations_) == 1.0