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

Decision boundary of logistic regression

You can start with logistic regression to test this function:

import numpy as npimport matplotlib.pyplot as pltfrom matplotlib import cm# sklearn.linear_model includes regression models where target variable is a linear combination of input variablesfrom sklearn.linear_model import LogisticRegression# make_moons is another useful function to generate sample datafrom sklearn.datasets import make_moonsfrom sklearn.model_selection import train_test_splitX, y = make_moons(n_samples=1000, noise=0.1, random_state=0)# Plot sample dataplt.scatter(X[:,0], X[:,1], c=y, cmap=cm.cool)plt.show()

We get the following plot:

Now, you can use the draw_decision_boundary function to visualize the decision boundary for ...

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