Skip to content

Commit

Permalink
Adaptive boosting
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSomen committed Jul 26, 2018
1 parent 3b1445c commit 88ea1c8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Ensemble_learning/ensemble_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,13 @@
rnd_clf = RandomForestClassifier(n_estimators=500, n_jobs=-1)
rnd_clf.fit(iris["data"], iris["target"])
for name, score in zip(iris["feature_names"], rnd_clf.feature_importances_):
print(name, score)
print(name, score)

#%%
'''Adative boostng'''
from sklearn.ensemble import AdaBoostClassifier
ada_clf = AdaBoostClassifier(
DecisionTreeClassifier(max_depth=1), n_estimators=200,
algorithm="SAMME.R", learning_rate=0.5
)
ada_clf.fit(X_train, Y_train)

0 comments on commit 88ea1c8

Please sign in to comment.