September 2019
Intermediate to advanced
420 pages
10h 29m
English
We can, for instance, build an ensemble from a collection of 10 k-NN classifiers as follows:
In [1]: from sklearn.ensemble import BaggingClassifier... from sklearn.neighbors import KNeighborsClassifier... bag_knn = BaggingClassifier(KNeighborsClassifier(),... n_estimators=10)
The BaggingClassifier class provides a number of options to customize the ensemble:
Read now
Unlock full access