Skip to content
Discussion options

You must be logged in to vote

Hi,
the key is to get the coordinates of each grid point (here the number is 101*101), and treat them as a "new dataset" X_pred_on. Then, predict the label (0 or 1) for these grid points. Finally plt.contourf will plot with filled color and also the boundary.

btw, you can always print the intermediate result to see what's going on.

You can refer to
meshgrid
ravel
column_stack
contourf

Hope this helps 😄

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AS1100K
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants