Skip to content

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

Merged
adrinjalali merged 6 commits into
scikit-learn:masterfrom
cmarmo:plot-tree-rotate
Dec 7, 2019
Merged

Deprecate unused 'rotate' parameter in tree.plot_tree.#15806
adrinjalali merged 6 commits into
scikit-learn:masterfrom
cmarmo:plot-tree-rotate

Conversation

@cmarmo

@cmarmo cmarmo commented Dec 5, 2019

Copy link
Copy Markdown
Contributor

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

Comment thread sklearn/tree/_export.py Outdated
Comment thread sklearn/tree/_export.py Outdated

@glemaitre glemaitre left a comment

Copy link
Copy Markdown
Member

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)

Comment thread sklearn/tree/_export.py Outdated
Comment thread sklearn/tree/_export.py Outdated
@glemaitre

Copy link
Copy Markdown
Member

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

Comment thread sklearn/tree/tests/test_export.py Outdated

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

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:

Comment thread sklearn/tree/tests/test_export.py Outdated
Co-Authored-By: Olivier Grisel <olivier.grisel@ensta.org>

@adrinjalali adrinjalali left a comment

Copy link
Copy Markdown
Member

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