Ejemplo n.º 1
0
 def test_two_estimators_predict1(self):
     pipeline = (
         StandardScaler() >>
         (PCA() & Nystroem() & PassiveAggressiveClassifier()) >>
         ConcatFeatures() >> NoOp() >> PassiveAggressiveClassifier())
     trained = pipeline.fit(self.X_train, self.y_train)
     trained.predict(self.X_test)
Ejemplo n.º 2
0
 def test_remove_last2(self):
     pipeline = (StandardScaler() >>
                 (PCA() & Nystroem() & PassiveAggressiveClassifier()) >>
                 ConcatFeatures() >> NoOp() >>
                 (PassiveAggressiveClassifier() & LogisticRegression()))
     with self.assertRaises(ValueError):
         pipeline.remove_last()
Ejemplo n.º 3
0
 def test_remove_last4(self):
     pipeline = StandardScaler() >> (
         PCA() & Nystroem() & PassiveAggressiveClassifier()
     ) >> ConcatFeatures() >> NoOp() >> PassiveAggressiveClassifier()
     new_pipeline = pipeline.remove_last(inplace=True)
     self.assertEqual(len(new_pipeline._steps), 6)
     self.assertEqual(len(pipeline._steps), 6)
Ejemplo n.º 4
0
 def test_two_estimators_predict_proba1(self):
     pipeline = StandardScaler() >> (
         PCA() & Nystroem() & PassiveAggressiveClassifier()
     ) >> ConcatFeatures() >> NoOp() >> PassiveAggressiveClassifier()
     pipeline.fit(self.X_train, self.y_train)
     with self.assertRaises(ValueError):
         pipeline.predict_proba(self.X_test)
Ejemplo n.º 5
0
 def test_remove_last5(self):
     pipeline = (
         StandardScaler()
         >> (PCA() & Nystroem() & PassiveAggressiveClassifier())
         >> ConcatFeatures()
         >> NoOp()
         >> PassiveAggressiveClassifier()
     )
     pipeline.remove_last(inplace=True).freeze_trainable()
Ejemplo n.º 6
0
    def test_passive_aggressive_classifier(self):
        from lale.lib.sklearn import PassiveAggressiveClassifier

        reg = PassiveAggressiveClassifier(validation_fraction=0.4, early_stopping=False)
        reg.fit(self.X_train, self.y_train)
Ejemplo n.º 7
0
 def test_passive_aggressive_classifier(self):
     reg = PassiveAggressiveClassifier(validation_fraction=0.4,
                                       early_stopping=False)
     reg.fit(self.X_train, self.y_train)