本文整理匯總了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_)