8000 DOC Ensures that SelectFwe passes numpydoc validation (#20986) · scikit-learn/scikit-learn@ad127a5 · GitHub
[go: up one dir, main page]

Skip to content

Commit ad127a5

Browse files
jmloyolaglemaitre
authored andcommitted
DOC Ensures that SelectFwe passes numpydoc validation (#20986)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
1 parent 693a348 commit ad127a5

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

maint_tools/test_docstrings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
"SGDOneClassSVM",
6262
"SGDRegressor",
6363
"SelectFromModel",
64-
"SelectFwe",
6564
"SelfTrainingClassifier",
6665
"SequentialFeatureSelector",
6766
"SimpleImputer",

sklearn/feature_selection/_univariate_selection.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ def _get_support_mask(self):
785785

786786

787787
class SelectFwe(_BaseFilter):
788-
"""Filter: Select the p-values corresponding to Family-wise error rate
788+
"""Filter: Select the p-values corresponding to Family-wise error rate.
789789
790790
Read more in the :ref:`User Guide <univariate_feature_selection>`.
791791
@@ -800,17 +800,6 @@ class SelectFwe(_BaseFilter):
800800
alpha : float, default=5e-2
801801
The highest uncorrected p-value for features to keep.
802802
803-
Examples
804-
--------
805-
>>> from sklearn.datasets import load_breast_cancer
806-
>>> from sklearn.feature_selection import SelectFwe, chi2
807-
>>> X, y = load_breast_cancer(return_X_y=True)
808-
>>> X.shape
809-
(569, 30)
810-
>>> X_new = SelectFwe(chi2, alpha=0.01).fit_transform(X, y)
811-
>>> X_new.shape
812-
(569, 15)
813-
814803
Attributes
815804
----------
816805
scores_ : array-like of shape (n_features,)
@@ -842,6 +831,17 @@ class SelectFwe(_BaseFilter):
842831
SelectFdr : Select features based on an estimated false discovery rate.
843832
GenericUnivariateSelect : Univariate feature selector with configurable
844833
mode.
834+
835+
Examples
836+
--------
837+
>>> from sklearn.datasets import load_breast_cancer
838+
>>> from sklearn.feature_selection import SelectFwe, chi2
839+
>>> X, y = load_breast_cancer(return_X_y=True)
840+
>>> X.shape
841+
(569, 30)
842+
>>> X_new = SelectFwe(chi2, alpha=0.01).fit_transform(X, y)
843+
>>> X_new.shape
844+
(569, 15)
845845
"""
846846

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

0 commit comments

Comments
 (0)
0