Hands-On Machine Learning with Scikit-Learn and TensorFlow


x = argmax k ∑ j = 1 y j x



Download 26,57 Mb.
Pdf ko'rish
bet166/225
Sana16.03.2022
Hajmi26,57 Mb.
#497859
1   ...   162   163   164   165   166   167   168   169   ...   225
Bog'liq
Hands on Machine Learning with Scikit Learn Keras and TensorFlow

= argmax
k

j
= 1
y j
=
k
N
α
j
where
N
is the number of predictors.
206 | Chapter 7: Ensemble Learning and Random Forests


16
For more details, see “Multi-Class AdaBoost,” J. Zhu et al. (2006).
17
First introduced in “Arcing the Edge,” L. Breiman (1997), and further developed in the paper “Greedy Func‐
tion Approximation: A Gradient Boosting Machine,” Jerome H. Friedman (1999).
Scikit-Learn actually uses a multiclass version of AdaBoost called 
SAMME
stands for 
Stagewise Additive Modeling using a Multiclass Exponential loss function
).
When there are just two classes, SAMME is equivalent to AdaBoost. Moreover, if the
predictors can estimate class probabilities (i.e., if they have a 
predict_proba()
method), Scikit-Learn can use a variant of SAMME called 
SAMME.R
(the 
R
stands
for “Real”), which relies on class probabilities rather than predictions and generally
performs better.
The following code trains an AdaBoost classifier based on 200 
Decision Stumps
using
Scikit-Learn’s 
AdaBoostClassifier
class (as you might expect, there is also an 
Ada
BoostRegressor
class). A Decision Stump is a Decision Tree with 
max_depth=1
—in
other words, a tree composed of a single decision node plus two leaf nodes. This is
the default base estimator for the 
AdaBoostClassifier
class:
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
)
If your AdaBoost ensemble is overfitting the training set, you can
try reducing the number of estimators or more strongly regulariz‐
ing the base estimator.

Download 26,57 Mb.

Do'stlaringiz bilan baham:
1   ...   162   163   164   165   166   167   168   169   ...   225




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish