Exemplo n.º 1
0
 def test_remove_last2(self):
     pipeline = (StandardScaler() >>
                 (PCA() & Nystroem() & PassiveAggressiveClassifier()) >>
                 ConcatFeatures() >> NoOp() >>
                 (PassiveAggressiveClassifier() & LogisticRegression()))
     with self.assertRaises(ValueError):
         pipeline.remove_last()
Exemplo n.º 2
0
 def test_remove_last5(self):
     pipeline = (
         StandardScaler()
         >> (PCA() & Nystroem() & PassiveAggressiveClassifier())
         >> ConcatFeatures()
         >> NoOp()
         >> PassiveAggressiveClassifier()
     )
     pipeline.remove_last(inplace=True).freeze_trainable()
Exemplo 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)