-
Notifications
You must be signed in to change notification settings - Fork 855
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
Adds style related dictionaries to plot_decision_regions #342
Conversation
Additional TODO:
|
mlxtend/plotting/decision_regions.py
Outdated
|
||
return ax | ||
|
||
|
||
def format_plotting_kwargs(default_kwargs=None, user_kwargs=None, |
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.
That's a nice function dealing with the issues of protected keys! One little thing that comes to mind is that the way I wrote the API parser for the documentation, this would show up in the plotting API docs as well. You could make this function private by prefixing it with an underscore (_format_plotting_kwargs
), but I think this function can come in very handy in other functions (esp. plotting functions) as well in future. So, it would be nice if you could move it to the mlxtend.utils
:)
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.
I don't have a better name at hand, but under a more general name like "format_kwarg_dictionaries" or so?
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.
Sounds good to me! I have a couple of quick questions:
-
Should this function go into its own module in
utils
, maybeplotting.py
, or into one of the existing modules likechecking.py
? -
Should I also add the leading underscore to make this function private in
utils
(i.e._format_kwarg_dictionaries
vs.format_kwarg_dictionaries
)? I'd imagine this function will only be used for internal stuff and not directly by users, so the leading underscore would make sense.
Thanks!
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.
Good points! I think we could put it into checking, because it's somewhat related to checking kwargs. I wouldn't suggest making it private, because it's generally useful (how I think about private things is that these are more like helper functions that are not useful outside the scope of a particular function and more like a side effect of refactoring, whereas the public ones are more broadly useful).
I can also add a |
Thanks, that would be super nice :) |
Unless you have any other comments, I think this PR should be good to go! |
Based on the code, this looks great, thanks so much! I will take a look at the notebook as well and give it a try, but it looks perfect so far! |
Looks and works perfectly, thanks for the great contribution! |
Description
This PR adds parameters to
plot_decision_regions
that can be used to customize the plotting style used (e.g. size of scatter plot markers, alpha value of decision regions, etc.)Related issues or pull requests
Fixes #340
Pull Request requirements
./mlxtend/*/tests
directoriesnosetests ./mlxtend -sv
and make sure that all unit tests passnosetests ./mlxtend --with-coverage
flake8 ./mlxtend
./docs/sources/CHANGELOG.md
filemlxtend/docs/sources/
(optional)