Mastering Machine Learning with Python in Six Steps: A Practical Implementation Guide to Predictive Data Analytics Using Python by Manohar Swamynathan

Mastering Machine Learning with Python in Six Steps: A Practical Implementation Guide to Predictive Data Analytics Using Python by Manohar Swamynathan

Author:Manohar Swamynathan [Manohar Swamynathan]
Language: eng
Format: epub, pdf
Publisher: Apress
Published: 2018-09-25T00:00:00+00:00


out = map_features(data['x1'], data['x2'], order=order_no)

X = out.transpose()

y = data['class']

# split the data into train and test

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=0)

# function to draw classifier line

def draw_boundary(classifier):

dim = np.linspace(-0.8, 1.1, 100)

dx, dy = np.meshgrid(dim, dim)

v = map_features(dx.flatten(), dy.flatten(), order=order_no)

z = (np.dot(classifier.coef_, v) + classifier.intercept_).reshape(100, 100)

plt.contour(dx, dy, z, levels=[0], colors=['r'])



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.