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)
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)
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)
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)
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)