8000 DOC Ensures that SelectFdr passes numpydoc validation by jmloyola · Pull Request #20984 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

DOC Ensures that SelectFdr passes numpydoc validation #20984

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
Sep 9, 2021
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
1 change: 0 additions & 1 deletion maint_tools/test_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"RobustScaler",
"SGDOneClassSVM",
"SGDRegressor",
"SelectFdr",
"SelectFpr",
"SelectFromModel",
"SelectFwe",
Expand Down
32 changes: 16 additions & 16 deletions sklearn/feature_selection/_univariate_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ def _get_support_mask(self):


class SelectFdr(_BaseFilter):
"""Filter: Select the p-values for an estimated false discovery rate
"""Filter: Select the p-values for an estimated false discovery rate.

This uses the Benjamini-Hochberg procedure. ``alpha`` is an upper bound
on the expected false discovery rate.
Expand All @@ -717,17 +717,6 @@ class SelectFdr(_BaseFilter):
alpha : float, default=5e-2
The highest uncorrected p-value for features to keep.

Examples
--------
>>> from sklearn.datasets import load_breast_cancer
>>> from sklearn.feature_selection import SelectFdr, chi2
>>> X, y = load_breast_cancer(return_X_y=True)
>>> X.shape
(569, 30)
>>> X_new = SelectFdr(chi2, alpha=0.01).fit_transform(X, y)
>>> X_new.shape
(569, 16)

Attributes
----------
scores_ : array-like of shape (n_features,)
Expand All @@ -747,10 +736,6 @@ class SelectFdr(_BaseFilter):

.. versionadded:: 1.0

References
----------
https://en.wikipedia.org/wiki/False_discovery_rate

See Also
--------
f_classif : ANOVA F-value between label/feature for classification tasks.
Expand All @@ -765,6 +750,21 @@ class SelectFdr(_BaseFilter):
SelectFwe : Select features based on family-wise error rate.
GenericUnivariateSelect : Univariate feature selector with configurable
mode.

References
----------
https://en.wikipedia.org/wiki/False_discovery_rate

Examples
--------
>>> from sklearn.datasets import load_breast_cancer
>>> from sklearn.feature_selection import SelectFdr, chi2
>>> X, y = load_breast_cancer(return_X_y=True)
>>> X.shape
(569, 30)
>>> X_new = SelectFdr(chi2, alpha=0.01).fit_transform(X, y)
>>> X_new.shape
(569, 16)
"""

def __init__(self, score_func=f_classif, *, alpha=5e-2):
Expand Down
0