Created
December 13, 2013 16:07
-
-
Save audy/7946551 to your computer and use it in GitHub Desktop.
Example of using a Support Vector Machine in place of Decision Trees for the weak learner in Adaptive Boosting
This file contains 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
#!/usr/bin/env python | |
from sklearn.ensemble import AdaBoostClassifier | |
from sklearn.svm import SVC | |
from sklearn.datasets import load_iris | |
from sklearn.cross_validation import cross_val_score | |
data = load_iris() | |
features = data['data'] | |
labels = data['target'] | |
estimator = AdaBoostClassifier(base_estimator=SVC(probability=True)) | |
print cross_val_score(estimator, features, labels).mean() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment