Sebastian Raschka

2015-01-11 00:13:30 UTC

Hi,

I wrote a short blog post about implementing a conservative majority rule ensemble classifier in scikit-learn someone asked me whether this would be interesting for the scikit-learn library.

The idea behind it is quite simple: Using the weighted or unweighted majority rule from different classification models (naive Bayes, Logistic Regression, Random Forests etc.) to predict the class label.

clf1 = LogisticRegression()

clf2 = RandomForestClassifier()

clf3 = GaussianNB()

eclf = EnsembleClassifier(clfs=[clf1, clf2, clf3], weights=[1,1,1])

for clf, label in zip([clf1, clf2, clf3, eclf], ['Logistic Regression', 'Random Forest', 'naive Bayes', 'Ensemble']):

scores = cross_validation.cross_val_score(clf, X, y, cv=5, scoring='accuracy')

print("Accuracy: %0.2f (+/- %0.2f) [%s]" % (scores.mean(), scores.std(), label))

(more details in the blog post: http://sebastianraschka.com/Articles/2014_ensemble_classifier.html)

If you would consider this as useful, let me know, and I would be happy to contribute it to the scikit-learn library.

Best,

Sebastian

I wrote a short blog post about implementing a conservative majority rule ensemble classifier in scikit-learn someone asked me whether this would be interesting for the scikit-learn library.

The idea behind it is quite simple: Using the weighted or unweighted majority rule from different classification models (naive Bayes, Logistic Regression, Random Forests etc.) to predict the class label.

clf1 = LogisticRegression()

clf2 = RandomForestClassifier()

clf3 = GaussianNB()

eclf = EnsembleClassifier(clfs=[clf1, clf2, clf3], weights=[1,1,1])

for clf, label in zip([clf1, clf2, clf3, eclf], ['Logistic Regression', 'Random Forest', 'naive Bayes', 'Ensemble']):

scores = cross_validation.cross_val_score(clf, X, y, cv=5, scoring='accuracy')

print("Accuracy: %0.2f (+/- %0.2f) [%s]" % (scores.mean(), scores.std(), label))

(more details in the blog post: http://sebastianraschka.com/Articles/2014_ensemble_classifier.html)

If you would consider this as useful, let me know, and I would be happy to contribute it to the scikit-learn library.

Best,

Sebastian