-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update classification_template.py #2
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please answer on the comments below.
plt.legend() | ||
plt.show() | ||
|
||
X1, X2 = np.meshgrid(np.arange(start = X_set[:, 0].min() - 1, stop = X |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a syntax error to me. Ending brackets are missing, aren't they?
X1, X2 = np.meshgrid(np.arange(start = X_set[:, 0].min() - 1, stop = X_set[:, 0].max() + 1, step = 0.01), | ||
np.arange(start = X_set[:, 1].min() - 1, stop = X_set[:, 1].max() + 1, step = 0.01)) | ||
plt.contourf(X1, X2, classifier.predict(np.array([X1.ravel(), X2.ravel()]).T).reshape(X1.shape), | ||
alpha = 0.75, cmap = ListedColormap(('red', 'green'))) | ||
plt.xlim(X1.min(), X1.max()) | ||
plt.ylim(X2.min(), X2.max()) | ||
for i, j in enumerate(np.unique(y_set)): | ||
plt.scatter(X_set[y_set == j, 0], X_set[y_set == j, 1], | ||
c = ListedColormap(('red', 'green'))(i), label = j) | ||
plt.title('Classifier (Training set)') | ||
plt.xlabel('Age') | ||
plt.ylabel('Estimated Salary') | ||
plt.legend() | ||
plt.show() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is here so that we can visualize the classifier results on training set. Why do you want to remove this code block?
No description provided.