def test_calc_rdm_movie_crossnobis_noise(self): noise = np.random.randn(10, 5) noise = np.matmul(noise.T, noise) rdm = rsr.calc_rdm_crossnobis(self.test_data_time_balanced, descriptor='conds', noise=noise) assert rdm.n_cond == 5
def test_calc_crossnobis_noise_list(self): # generate two positive definite noise matricies noise = np.random.randn(2, 10, 5) noise = np.einsum('ijk,ijl->ikl', noise, noise) rdm = rsr.calc_rdm_crossnobis(self.test_data_balanced, cv_descriptor='fold', descriptor='conds', noise=noise) assert rdm.n_cond == 5 # test with noise list noise = [noise[i] for i in range(len(noise))] rdm = rsr.calc_rdm_crossnobis(self.test_data_balanced, cv_descriptor='fold', descriptor='conds', noise=noise) assert rdm.n_cond == 5 rdm = rsr.calc_rdm_crossnobis(self.test_data, cv_descriptor='fold', descriptor='conds', noise=noise) assert rdm.n_cond == 6
def test_calc_rdm_movie_crossnobis_no_descriptors(self): rdm = rsr.calc_rdm_crossnobis(self.test_data_time_balanced, descriptor='conds') assert rdm.n_cond == 5
def test_calc_crossnobis(self): rdm = rsr.calc_rdm_crossnobis(self.test_data, descriptor='conds', cv_descriptor='fold') assert rdm.n_cond == 6