Skip to Main Content
Ensemble Machine Learning Cookbook
book

Ensemble Machine Learning Cookbook

by Dipayan Sarkar, Vijayalakshmi Natarajan
January 2019
Beginner to intermediate content levelBeginner to intermediate
336 pages
7h 58m
English
Packt Publishing
Content preview from Ensemble Machine Learning Cookbook

There's more...

Here, we will showcase training a model using AdaBoost with a support vector machine (SVM) as the base learner. 

By default, AdaBoost uses a decision tree as the base learner. We can use different base learners as well. In the following example, we have used an SVM as our base learner with the AdaBoost algorithm. We use SVC with rbf as the kernel:

from sklearn.svm import SVCAdaboost_with_svc_rbf = AdaBoostClassifier(n_estimators=100, base_estimator=SVC(probability=True, kernel='rbf'), learning_rate=1, random_state=0)Adaboost_with_svc_rbf.fit(X_train, Y_train)

We can check the accuracy and the AUC values of our AdaBoost model with support vector classifier (SVC) as the base learner:

# Mean accuracyprint('The mean accuracy is: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Productive and Efficient Data Science with Python: With Modularizing, Memory profiles, and Parallel/GPU Processing

Productive and Efficient Data Science with Python: With Modularizing, Memory profiles, and Parallel/GPU Processing

Tirthajyoti Sarkar
Hands-On Automated Machine Learning

Hands-On Automated Machine Learning

Sibanjan Das, Umit Mert Cakmak

Publisher Resources

ISBN: 9781789136609Supplemental Content