本文整理汇总了Python中msmbuilder.msm.ContinuousTimeMSM.score方法的典型用法代码示例。如果您正苦于以下问题:Python ContinuousTimeMSM.score方法的具体用法?Python ContinuousTimeMSM.score怎么用?Python ContinuousTimeMSM.score使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msmbuilder.msm.ContinuousTimeMSM
的用法示例。
在下文中一共展示了ContinuousTimeMSM.score方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_score_2
# 需要导入模块: from msmbuilder.msm import ContinuousTimeMSM [as 别名]
# 或者: from msmbuilder.msm.ContinuousTimeMSM import score [as 别名]
def test_score_2():
ds = MullerPotential(random_state=0).get_cached().trajectories
cluster = NDGrid(n_bins_per_feature=6,
min=[PARAMS['MIN_X'], PARAMS['MIN_Y']],
max=[PARAMS['MAX_X'], PARAMS['MAX_Y']])
assignments = cluster.fit_transform(ds)
test_indices = [5, 0, 4, 1, 2]
train_indices = [3, 6, 7, 8, 9]
model = ContinuousTimeMSM(lag_time=3, n_timescales=1)
model.fit([assignments[i] for i in train_indices])
test = model.score([assignments[i] for i in test_indices])
train = model.score_
print('train', train, 'test', test)
assert 1 <= test < 2
assert 1 <= train < 2
示例2: test_score_2
# 需要导入模块: from msmbuilder.msm import ContinuousTimeMSM [as 别名]
# 或者: from msmbuilder.msm.ContinuousTimeMSM import score [as 别名]
def test_score_2():
from msmbuilder.example_datasets.muller import MULLER_PARAMETERS as PARAMS
ds = MullerPotential(random_state=0).get()['trajectories']
cluster = NDGrid(n_bins_per_feature=6,
min=[PARAMS['MIN_X'], PARAMS['MIN_Y']],
max=[PARAMS['MAX_X'], PARAMS['MAX_Y']])
assignments = cluster.fit_transform(ds)
test_indices = [5, 0, 4, 1, 2]
train_indices = [3, 6, 7, 8, 9]
model = ContinuousTimeMSM(lag_time=3, n_timescales=1)
model.fit([assignments[i] for i in train_indices])
test = model.score([assignments[i] for i in test_indices])
train = model.score_
print('train', train, 'test', test)
assert 1 <= test < 2
assert 1 <= train < 2
示例3: test_score_3
# 需要导入模块: from msmbuilder.msm import ContinuousTimeMSM [as 别名]
# 或者: from msmbuilder.msm.ContinuousTimeMSM import score [as 别名]
def test_score_3():
ds = MullerPotential(random_state=0).get_cached().trajectories
cluster = NDGrid(n_bins_per_feature=6,
min=[PARAMS['MIN_X'], PARAMS['MIN_Y']],
max=[PARAMS['MAX_X'], PARAMS['MAX_Y']])
assignments = cluster.fit_transform(ds)
train_indices = [9, 4, 3, 6, 2]
test_indices = [8, 0, 5, 7, 1]
model = ContinuousTimeMSM(lag_time=3, n_timescales=1, sliding_window=False,
ergodic_cutoff=1)
train_data = [assignments[i] for i in train_indices]
test_data = [assignments[i] for i in test_indices]
model.fit(train_data)
train = model.score_
test = model.score(test_data)
print(train, test)
示例4: test_score_3
# 需要导入模块: from msmbuilder.msm import ContinuousTimeMSM [as 别名]
# 或者: from msmbuilder.msm.ContinuousTimeMSM import score [as 别名]
def test_score_3():
from msmbuilder.example_datasets.muller import MULLER_PARAMETERS as PARAMS
cluster = NDGrid(n_bins_per_feature=6,
min=[PARAMS['MIN_X'], PARAMS['MIN_Y']],
max=[PARAMS['MAX_X'], PARAMS['MAX_Y']])
ds = MullerPotential(random_state=0).get()['trajectories']
assignments = cluster.fit_transform(ds)
train_indices = [9, 4, 3, 6, 2]
test_indices = [8, 0, 5, 7, 1]
model = ContinuousTimeMSM(lag_time=3, n_timescales=1, sliding_window=False, ergodic_cutoff=1)
train_data = [assignments[i] for i in train_indices]
test_data = [assignments[i] for i in test_indices]
model.fit(train_data)
train = model.score_
test = model.score(test_data)
print(train, test)
示例5: test_score_1
# 需要导入模块: from msmbuilder.msm import ContinuousTimeMSM [as 别名]
# 或者: from msmbuilder.msm.ContinuousTimeMSM import score [as 别名]
def test_score_1():
grid = NDGrid(n_bins_per_feature=5, min=-np.pi, max=np.pi)
seqs = grid.fit_transform(load_doublewell(random_state=0)['trajectories'])
model = ContinuousTimeMSM(verbose=False, lag_time=10, n_timescales=3).fit(seqs)
np.testing.assert_approx_equal(model.score(seqs), model.score_)