def test_design_matrix(self):
     x_train = TEST_DATA['design_matrix']['x_train']
     M = TEST_DATA['design_matrix']['M']
     dm_expected = TEST_DATA['design_matrix']['dm']
     dm = design_matrix(x_train, M)
     self.assertEqual(np.shape(dm), (20, 8))
     np.testing.assert_almost_equal(dm, dm_expected)
示例#2
0
文件: test.py 项目: jacekbla/spyder1
 def test_design_matrix(self):
     x_train = TEST_DATA['design_matrix']['x_train']
     M = TEST_DATA['design_matrix']['M']
     dm = TEST_DATA['design_matrix']['dm']
     dm_computed = design_matrix(x_train, M)
     max_diff = np.max(np.abs(dm - dm_computed))
     self.assertAlmostEqual(max_diff, 0, 8)