Skip to content
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

Deprecate unused 'rotate' parameter in tree.plot_tree. #15806

Merged
merged 6 commits into from Dec 7, 2019

Conversation

cmarmo
Copy link
Member

@cmarmo cmarmo commented Dec 5, 2019

Reference Issues/PRs

Fixes #15694.
Originally reported in #13971.

What does this implement/fix? Explain your changes.

As suggested in the corresponding issue and on the discussion mailing list, the rotate parameter is deprecated. Will be removed in 0.25

sklearn/tree/_export.py Outdated Show resolved Hide resolved
sklearn/tree/_export.py Outdated Show resolved Hide resolved
Copy link
Contributor

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The small test would be along the line:

# FIXME: to be removed in 0.25
def test_plot_tree_rotate_deprecation():
    # test that a warning is raised when rotate is used.
    match = "The warning message"
    with pytest.warns(FutureWarning, match=match):
        plot_tree(..., rotate=True)

sklearn/tree/_export.py Outdated Show resolved Hide resolved
sklearn/tree/_export.py Outdated Show resolved Hide resolved
@glemaitre
Copy link
Contributor

LGTM. We are just missing an entry in what's new 0.23

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a missing pytest fixture to get the tests to pass on the CI:

sklearn/tree/tests/test_export.py Outdated Show resolved Hide resolved
Co-Authored-By: Olivier Grisel <olivier.grisel@ensta.org>
Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cmarmo

@adrinjalali adrinjalali merged commit 9c62eee into scikit-learn:master Dec 7, 2019
@cmarmo cmarmo deleted the plot-tree-rotate branch December 9, 2019 09:19
panpiort8 pushed a commit to panpiort8/scikit-learn that referenced this pull request Mar 3, 2020
…arn#15806)

* Deprecate unused 'rotate' parameter in tree.plot_tree.

* Clarify warning and docstring. Add test.

* Fix lint error and adress comment.

* Fix python lint error.

* Add what's new entry. Conform to skl convention.

* Update sklearn/tree/tests/test_export.py

Co-Authored-By: Olivier Grisel <olivier.grisel@ensta.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plot_tree Rotate parameter isn't taken into account
5 participants