Skip to content
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