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

Skip to content

DOC Ensures that SelectFwe passes numpydoc validation #20986

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 3 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 @@ -61,7 +61,6 @@
"SGDOneClassSVM",
"SGDRegressor",
"SelectFromModel",
"SelectFwe",
"SelfTrainingClassifier",
"SequentialFeatureSelector",
"SimpleImputer",
Expand Down
24 changes: 12 additions & 12 deletions sklearn/feature_selection/_univariate_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ def _get_support_mask(self):


class SelectFwe(_BaseFilter):
"""Filter: Select the p-values corresponding to Family-wise error rate
"""Filter: Select the p-values corresponding to Family-wise error rate.

Read more in the :ref:`User Guide <univariate_feature_selection>`.

Expand All @@ -800,17 +800,6 @@ class SelectFwe(_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 SelectFwe, chi2
>>> X, y = load_breast_cancer(return_X_y=True)
>>> X.shape
(569, 30)
>>> X_new = SelectFwe(chi2, alpha=0.01).fit_transform(X, y)
>>> X_new.shape
(569, 15)

Attributes
----------
scores_ : array-like of shape (n_features,)
Expand Down Expand Up @@ -842,6 +831,17 @@ class SelectFwe(_BaseFilter):
SelectFdr : Select features based on an estimated false discovery rate.
GenericUnivariateSelect : Univariate feature selector with configurable
mode.

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

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