Beispiel #1
0
 def test_blocksplit_dtrajs_cvsplit(self):
     dtrajs = [
         np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]),
         np.array([0, 1, 9, 10])
     ]
     for lag in range(1, 5):
         dtrajs_new = blocksplit_dtrajs(dtrajs,
                                        lag=lag,
                                        sliding=False,
                                        shift=0)
         dtrajs_train, dtrajs_test = cvsplit_dtrajs(dtrajs_new)
         dtrajs_train = ensure_dtraj_list(dtrajs_train)
         dtrajs_test = ensure_dtraj_list(dtrajs_test)
         assert len(dtrajs_train) > 0
         assert len(dtrajs_test) > 0
Beispiel #2
0
 def test_blocksplit_dtrajs_sliding(self):
     dtrajs = [
         np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]),
         np.array([0, 1, 9, 10])
     ]
     for lag in range(1, 10):
         dtrajs_new = blocksplit_dtrajs(dtrajs, lag=lag, sliding=True)
         C1 = msmtools.estimation.count_matrix(dtrajs,
                                               lag,
                                               sliding=True,
                                               nstates=11).toarray()
         C2 = msmtools.estimation.count_matrix(dtrajs_new,
                                               lag,
                                               sliding=True,
                                               nstates=11).toarray()
         assert np.all(C1 == C2)
Beispiel #3
0
 def _blocksplit_dtrajs(self, dtrajs, sliding):
     from pyemma.msm.estimators._dtraj_stats import blocksplit_dtrajs
     return blocksplit_dtrajs(dtrajs, lag=self.lag, sliding=sliding)