示例#1
0
 def test_project_pca(self):
     data = self.ionosphere
     projector = ProjectPCA(n_components=5)
     data_pc = projector(data)
     self.assertEqual(data_pc.X.shape[1], 5)
     self.assertTrue((data.metas == data_pc.metas).all())
     self.assertTrue((data.Y == data_pc.Y).any())
示例#2
0
 def test_project_pca_default(self):
     data = Table("ionosphere")
     projector = ProjectPCA()
     data_pc = projector(data)
     self.assertTrue(data_pc.X.shape[1] == data.X.shape[1])
     self.assertTrue((data.metas == data_pc.metas).all())
     self.assertTrue((data.Y == data_pc.Y).any())
示例#3
0
 def test_project_pca_default(self):
     data = self.ionosphere
     projector = ProjectPCA()
     data_pc = projector(data)
     self.assertEqual(data_pc.X.shape[1], data.X.shape[1])
     self.assertTrue((data.metas == data_pc.metas).all())
     self.assertTrue((data.Y == data_pc.Y).any())
示例#4
0
 def test_project_pca(self):
     data = Table("ionosphere")
     projector = ProjectPCA(n_components=5)
     data_pc = projector(data)
     self.assertTrue(data_pc.X.shape[1] == 5)
     self.assertTrue((data.metas == data_pc.metas).all())
     self.assertTrue((data.Y == data_pc.Y).any())
示例#5
0
 def createinstance(params):
     n_components = params.get("n_components", 10)
     return ProjectPCA(n_components=n_components)