Created
July 10, 2019 12:08
-
-
Save risenW/4284e9f0a14ce210e7a6af42bb116ed4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Import the module | |
from sklearn.ensemble import VotingClassifier | |
#Pass the classifiers as a list of tuples with model names and the models themselves | |
max_model = VotingClassifier(estimators=[('logistic_reg', log_cf), ('KNN Classifier', knn_cf), ("SVC", svc_cf)], voting='hard') | |
max_model.fit(X_train, y_train) | |
print("Max Voting in sklearn") | |
print(get_acc(max_model.predict(X_val), y_val)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment