8000 DOC Rework IsolationForest example by ArturoAmorQ · Pull Request #24917 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

DOC Rework IsolationForest example #24917

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

Merged
merged 9 commits into from
Nov 15, 2022

Conversation

ArturoAmorQ
Copy link
Member

Reference Issues/PRs

Fixes #16113.

What does this implement/fix? Explain your changes.

The original narrative labels samples as "training observations", "new regular observations" and "new abnormal observations". This PR labels samples as "outlier" vs "inlier", which is closer to a real life user case.

This PR also implements a discrete decision boundary and a bit of narration, has suggested in this comment. For such purpose it uses a DecisionBoundaryDisplay, as it reduces boilerplate code and helps keeping the attention on the interpretation.

Any other comments?

Side effect: Implements notebook style as intended in #22406.

Part of the "tutorialization" series.

loc="upper left",
)
disp.ax_.set_title("Path length decision boundary of IsolationForest")
Copy link
Member

Choose a reason for hiding this comment

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

It could be nice to have a colorbar or have the level of the isoline in terms of the decision. I don't recall if setting plot_method="pcolormesh" would make the level of the isoline. But we can for sure add a colorbar otherwise (cf. quick example)

Copy link
Member Author

Choose a reason for hiding this comment

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

It's done, but I am having problems with interpreting the colorbar, so any feedback on that side is really appreciated!

Copy link
Member

Choose a reason for hiding this comment

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

It corresponds to the score of confidence to be an outlier or not. 1 is an inlier and 0 is an outlier.

Copy link
Member
@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.

LGTM

@glemaitre glemaitre merged commit 9c3c2c5 into scikit-learn:main Nov 15, 2022
@ArturoAmorQ ArturoAmorQ deleted the isolation_forest branch November 15, 2022 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Misleading plot example for Isolation Forest method
2 participants
0