-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Utility function to plot decision regions #5070
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
Conversation
Thanks for the PR. It would also be nice to use this function in the docs instead of reimplementing it all the time. |
Sure, once we agreed on a nice interface and implementation, I think it would be worthwhile to go through the documentation and substitute the lengthy code for plotting decision regions. About the tests: How are we going to handle those? I am not sure if it makes sense to write unittests for a plotting function, but maybe at least testing that it gets important correctly. Also, I could maybe add an IPython notebook somewhere so that someone can just hit "run all" and see if the plots make sense after making some modifications to the function or so. So, the current to do list is
|
I'm not sure about the testing. We have a decorator that skips if no matplotlib is available. I guess just running the function and seed that it runs without errors should be ok? |
I was just going through my to do list and wanted to leave a little sign of life here since it has been already ~3 weeks since the last commit. Currently, I am very, very busy, but this will change in about ~1-2 weeks so that I can finish what I have started here ;) |
no worries, thanks for the heads-up :) |
This pull request introduces 4 alerts when merging 32267ea into 3e29334 - view on LGTM.com new alerts:
Comment posted by LGTM.com |
I am closing this PR because #16061 has been merged with a new API to plot decision boundaries. Examples in the gallery have been updated using the new API. |
A simple utility function to plot decision regions to avoid implementing the code over and over (e.g., in the scikit-learn documentation examples; I feel like this could make the code leaner and easier to read).
I am wondering though how to implement unittests for this. Any ideas?
Other "to dos" may be:
True
andFalse
let the user provide a custom marker list viacycle
marker, e.g., in the format, e.g., as string 'sxo^v' (squares, crosses, circles, upper triangles, lower triangles)figure
object?Here are some examples how it currently looks like:
Simple 2D Plot
Highlighting test data points
1D example
Let me know what you think @amueller