Skip to Content
Hands-On Automated Machine Learning
book

Hands-On Automated Machine Learning

by Sibanjan Das, Umit Mert Cakmak
April 2018
Beginner to intermediate content levelBeginner to intermediate
282 pages
6h 52m
English
Packt Publishing
Content preview from Hands-On Automated Machine Learning

Drawing decision boundaries

The following code snippet will allow you to examine the decision boundaries of different types of algorithms:

import matplotlib.cm as cm# This function will scale training datatset and train given classifier.# Based on predictions it will draw decision boundaries.def draw_decision_boundary(clf, X, y, h = .01, figsize=(9,9), boundary_cmap=cm.winter, points_cmap=cm.cool):    # After you apply StandardScaler, feature means will be removed and all features will have unit variance.    from sklearn.preprocessing import StandardScaler    X = StandardScaler().fit_transform(X)    # Splitting dataset to train and test sets.    X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.4, random_state=42) # Training given estimator ...
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

Automated Machine Learning

Automated Machine Learning

Adnan Masood
R: Unleash Machine Learning Techniques

R: Unleash Machine Learning Techniques

Raghav Bali, Dipanjan Sarkar, Brett Lantz, Cory Lesmeister

Publisher Resources

ISBN: 9781788629898Supplemental Content