machine learning - AdaBoostClassifier with different base learners -


i trying use adaboostclassifier base learner other decisiontree. have tried svm , kneighborsclassifier errors. can 1 point out classifiers can used adaboostclassifier?

ok, have systematic method find out base learners supported adaboostclassifier. compatible base learner's fit method needs support sample_weight, can obtained running following code:

import inspect sklearn.utils.testing import all_estimators name, clf in all_estimators(type_filter='classifier'):     if 'sample_weight' in inspect.getargspec(clf().fit)[0]:        print name 

this results in following output: adaboostclassifier, bernoullinb, decisiontreeclassifier, extratreeclassifier, extratreesclassifier, multinomialnb, nusvc, perceptron, randomforestclassifier, ridgeclassifiercv, sgdclassifier, svc.

if classifier doesn't implement predict_proba, have set adaboostclassifier parameter algorithm = 'samme'.

thanks andreas showing how list estimators.


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo