示例#1
0
 def test_with_defaults(self):
     trainable = VotingClassifier(
         estimators=[("lr",
                      LogisticRegression()), ("dt",
                                              DecisionTreeClassifier())])
     trained = trainable.fit(self.train_X, self.train_y)
     _ = trained.predict(self.test_X)
示例#2
0
 def test_with_lale_classifiers(self):
     clf = VotingClassifier(
         estimators=[("knn",
                      KNeighborsClassifier()), ("lr",
                                                LogisticRegression())])
     trained = clf.fit(self.X_train, self.y_train)
     trained.predict(self.X_test)
示例#3
0
 def test_estimators(self):
     trainable = VotingClassifier(estimators=[(
         'lr',
         LogisticRegression()), ('dt',
                                 DecisionTreeClassifier()), ('na', None)])
     trained = trainable.fit(self.train_X, self.train_y)
     predicted = trained.predict(self.test_X)
示例#4
0
 def test_estimators(self):
     trainable = VotingClassifier(estimators=[
         ("lr", LogisticRegression()),
         ("dt", DecisionTreeClassifier()),
         ("na", None),
     ])
     trained = trainable.fit(self.train_X, self.train_y)
     predicted = trained.predict(self.test_X)
示例#5
0
    def test_with_lale_pipeline(self):
        from lale.lib.sklearn import VotingClassifier

        clf = VotingClassifier(estimators=[
            ("knn", KNeighborsClassifier()),
            ("pca_lr", PCA() >> LogisticRegression()),
        ])
        trained = clf.fit(self.X_train, self.y_train)
        trained.predict(self.X_test)