8000 [MRG+1] Improved docstring for permutation_test_score (#8379 and #8564) by leereeves · Pull Request #8569 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG+1] Improved docstring for permutation_test_score (#8379 and #8564) #8569

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 2 commits into from
Mar 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions sklearn/cross_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1905,11 +1905,14 @@ def permutation_test_score(estimator, X, y, cv=None,
The scores obtained for each permutations.

pvalue : float
The returned value equals p-value if `scoring` returns bigger
numbers for better scores (e.g., accuracy_score). If `scoring` is
rather a loss function (i.e. when lower is better such as with
`mean_squared_error`) then this is actually the complement of the
p-value: 1 - p-value.
The p-value, which approximates the probability that the score would
be obtained by chance. This is calculated as:

`(C + 1) / (n_permutations + 1)`

Where C is the number of permutations whose score >= the true score.

The best possible p-value is 1/(n_permutations + 1), the worst is 1.0.

Notes
-----
Expand Down
13 changes: 8 additions & 5 deletions sklearn/model_selection/_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,14 @@ def permutation_test_score(estimator, X, y, groups=None, cv=None,
The scores obtained for each permutations.

pvalue : float
The returned value equals p-value if `scoring` returns bigger
numbers for better scores (e.g., accuracy_score). If `scoring` is
rather a loss function (i.e. when lower is better such as with
`mean_squared_error`) then this is actually the complement of the
p-value: 1 - p-value.
The p-value, which approximates the probability that the score would
be obtained by chance. This is calculated as:

`(C + 1) / (n_permutations + 1)`

Where C is the number of permutations whose score >= the true score.

The best possible p-value is 1/(n_permutations + 1), the worst is 1.0.

Notes
-----
Expand Down
0