August 2019
Intermediate to advanced
342 pages
9h 35m
English
As an example of the boosting method, we will instantiate an object of the AdaBoostClassifier type of the scikit-learn library, which provides us with the implementation of the AdaBoost algorithm; as a base estimator, we will also use an instance of the DecisionTreeClassifier class in this example and set the number of base estimators with the n_estimators parameter:
from sklearn.tree import DecisionTreeClassifierfrom sklearn.ensemble import AdaBoostClassifieradaboost = AdaBoostClassifier( DecisionTreeClassifier(), n_estimators=300 )
Another widely used boosting algorithm is the gradient boosting algorithm. To understand the characteristics of the gradient boosting algorithm, we must first introduce the concept of the ...
Read now
Unlock full access