DOC Update plot_permutation_test_for_classification.py#17385
Merged
ogrisel merged 16 commits intoscikit-learn:masterfrom Jul 31, 2020
Merged
DOC Update plot_permutation_test_for_classification.py#17385ogrisel merged 16 commits intoscikit-learn:masterfrom
ogrisel merged 16 commits intoscikit-learn:masterfrom
Conversation
thomasjpfan
reviewed
Jun 1, 2020
| # | ||
| # Next, we calculate the | ||
| # :func:`~sklearn.model_selection.permutation_test_score` using the original | ||
| # iris dataset, which has strong structure, and |
Member
There was a problem hiding this comment.
Maybe:
Suggested change
| # iris dataset, which has strong structure, and | |
| # iris dataset, which strongly predict the labels, and |
| # iris dataset, which has strong structure, and | ||
| # the randomly generated features and iris labels, which should have | ||
| # no dependency between features and labels. The | ||
| # :class:`~sklearn.svm.svc` classifier and :ref:`accuracy_score` are used. |
Member
There was a problem hiding this comment.
Suggested change
| # :class:`~sklearn.svm.svc` classifier and :ref:`accuracy_score` are used. | |
| # :class:`~sklearn.svm.SVC` classifier and :ref:`accuracy_score` are used. |
| # distribution by calculating the accuracy of the classifier | ||
| # on 1000 different permutations of the dataset, where features | ||
| # remain the same but labels undergo different permutations. This is the | ||
| # distribution for the null hypothesis that there is no dependency between |
Member
There was a problem hiding this comment.
Suggested change
| # distribution for the null hypothesis that there is no dependency between | |
| # distribution for the null hypothesis which states there is no dependency between |
| plt.legend() | ||
| plt.xlabel('Score') | ||
| score_iris, perm_scores_iris, pvalue_iris = permutation_test_score( | ||
| clf, X, y, scoring="accuracy", cv=cv, n_permutations=1000, n_jobs=1) |
Member
There was a problem hiding this comment.
Default is 1:
Suggested change
| clf, X, y, scoring="accuracy", cv=cv, n_permutations=1000, n_jobs=1) | |
| clf, X, y, scoring="accuracy", cv=cv, n_permutations=1000) |
| clf, X, y, scoring="accuracy", cv=cv, n_permutations=1000, n_jobs=1) | ||
|
|
||
| score_rand, perm_scores_rand, pvalue_rand = permutation_test_score( | ||
| clf, X_rand, y, scoring="accuracy", cv=cv, n_permutations=1000, n_jobs=1) |
Member
There was a problem hiding this comment.
Suggested change
| clf, X_rand, y, scoring="accuracy", cv=cv, n_permutations=1000, n_jobs=1) | |
| clf, X_rand, y, scoring="accuracy", cv=cv, n_permutations=1000) |
Member
Author
|
Thanks for the review @thomasjpfan! Amended. |
glemaitre
reviewed
Jun 18, 2020
Member
glemaitre
left a comment
There was a problem hiding this comment.
Overall looks good. Just little improvements to be considered.
examples/feature_selection/plot_permutation_test_for_classification.py
Outdated
Show resolved
Hide resolved
examples/feature_selection/plot_permutation_test_for_classification.py
Outdated
Show resolved
Hide resolved
examples/feature_selection/plot_permutation_test_for_classification.py
Outdated
Show resolved
Hide resolved
examples/feature_selection/plot_permutation_test_for_classification.py
Outdated
Show resolved
Hide resolved
examples/feature_selection/plot_permutation_test_for_classification.py
Outdated
Show resolved
Hide resolved
examples/feature_selection/plot_permutation_test_for_classification.py
Outdated
Show resolved
Hide resolved
examples/feature_selection/plot_permutation_test_for_classification.py
Outdated
Show resolved
Hide resolved
examples/feature_selection/plot_permutation_test_for_classification.py
Outdated
Show resolved
Hide resolved
examples/feature_selection/plot_permutation_test_for_classification.py
Outdated
Show resolved
Hide resolved
Member
Author
|
Thanks @glemaitre! Just let me know what you think we should do to avoid the text output from matplotlib: #17385 (comment) |
Member
Author
|
ping @glemaitre, changes made. |
jayzed82
pushed a commit
to jayzed82/scikit-learn
that referenced
this pull request
Oct 22, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
What does this implement/fix? Explain your changes.
Any other comments?