当前位置: 首页>>代码示例>>Python>>正文


Python MarkovStateModel.score_ll方法代码示例

本文整理汇总了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']]))
开发者ID:back2mars,项目名称:msmbuilder,代码行数:11,代码来源:test_msm.py

示例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])
开发者ID:back2mars,项目名称:msmbuilder,代码行数:11,代码来源:test_msm.py

示例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
开发者ID:Eigenstate,项目名称:msmbuilder,代码行数:20,代码来源:test_msm.py


注:本文中的msmbuilder.msm.MarkovStateModel.score_ll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。