示例#1
0
 def test_fit(self):
     from pyrsa.rdm import RDMs
     rdm = np.random.rand(2, 6)
     pattern_descriptors = {'test': ['a', 'b', 'c', 'd']}
     rdm_descriptors = {'ind': np.array([1, 2])}
     rdm_obj = RDMs(rdm,
                    dissimilarity_measure='euclid',
                    pattern_descriptors=pattern_descriptors,
                    rdm_descriptors=rdm_descriptors)
     m = model.ModelWeighted('Test Model', rdm_obj)
     train = rdm_obj.subset('ind', 2)
     theta = m.fit(train)
示例#2
0
 def test_fit(self):
     from pyrsa.rdm import RDMs
     rdm = np.random.rand(5, 15)
     pattern_descriptors = {'test': ['a', 'b', 'c', 'd', 'e', 'f']}
     rdm_descriptors = {'ind': np.array([1, 2, 3, 1, 2])}
     rdm_obj = RDMs(rdm,
                    dissimilarity_measure='euclid',
                    pattern_descriptors=pattern_descriptors,
                    rdm_descriptors=rdm_descriptors)
     m = model.ModelInterpolate('Test Model', rdm_obj)
     train = rdm_obj.subset('ind', 2)
     theta = m.fit(train)
     pre = m.predict(theta)