Esempio n. 1
0
 def test_iris(self, basis):
   X, y = load_iris(return_X_y=True)
   scml = SCML_Supervised(basis=basis, n_basis=85, k_genuine=7, k_impostor=5,
                          random_state=42)
   scml.fit(X, y)
   csep = class_separation(scml.transform(X), y)
   assert csep < 0.24
Esempio n. 2
0
 def test_big_n_features(self):
   X, y = make_classification(n_samples=100, n_classes=3, n_features=60,
                              n_informative=60, n_redundant=0, n_repeated=0,
                              random_state=42)
   X = StandardScaler().fit_transform(X)
   scml = SCML_Supervised(random_state=42)
   scml.fit(X, y)
   csep = class_separation(scml.transform(X), y)
   assert csep < 0.7
Esempio n. 3
0
 def test_iris(self, basis):
   """
   SCML applied to Iris dataset should give better results when
   computing class separation.
   """
   X, y = load_iris(return_X_y=True)
   before = class_separation(X, y)
   scml = SCML_Supervised(basis=basis, n_basis=85, k_genuine=7, k_impostor=5,
                          random_state=42)
   scml.fit(X, y)
   after = class_separation(scml.transform(X), y)
   assert before > after + 0.03  # It's better by a margin of 0.03