-
Notifications
You must be signed in to change notification settings - Fork 876
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
plot_decision_regions: Deprecated 'res' in favour of 'num' #309
plot_decision_regions: Deprecated 'res' in favour of 'num' #309
Conversation
Instead of specifying a min/max range dependant value, use a fixed number of points to draw in x- and y-axis with 'np.linspace' to generate the meshgrid.
Lookup the figure size and DPI to determine the optimal number of points to consider for the meshgrid.
Hello @arteymix! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on December 23, 2017 at 05:59 Hours UTC |
Remove the references to the 'res' option: user should not have to worry anymore and stick on the defaults.
Thanks for the PR. I like the idea of keeping but deprecating the "old" Currently, there seems to be one of the unit tests causing issues with the PR. Would be nice if you could take a look at it. Alternatively, I am also happy to help out with that (I think you would need to enable the "allow maintainer commits" option though |
I was thinking of having no option at all as it already yield the best graph for the current DPI. The maintainer edit option is already checked if you want to fix the unit test. |
So, in other words, you were thinking of removing So what I mean is that users, if not careful, could easily get misleading results. I think the best way would be to remove |
Honestly, I'd remove it too but leave plt.figure(dpi=600)
plot_decision_regions(...) |
Good point. Actually, I would leave it for the sake of backward comp. but only let it do sth if it's not set to None (plus add the deprecation warning). Regarding plt.figure(dpi=600)
plot_decision_regions(...) that sounds good. Were you planning on updating the documentation for that? |
wow, those plots look amazing! Thanks so much! I will be checking out your code now and fix the unit tests |
I think it should be good now! Once the ci-tests pass and you don't have further suggestions (or comments on the "cosmetic changes"), I think it should be good to merge! :) |
I think it's good to merge! There's still one thing I wanted to address: |
I think it's fine! Not sure how other people use this function, but I typically want to save the version that I generated & viewed :P. So, if you create the version you are happy with and then call |
Might be a bit bold move, but the default on this basically yield good plots independently of the data range, so it's just better to warn for using
res
and introduce a newnum
parameter.It also lookup the current figure to determine an optimal default (i.e. dpi * size).