8000 MAINT Parameter Validation for feature_selection.f_regression (#25736) · jpangas/scikit-learn@93acdf2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 93acdf2

Browse files
ZeeshanLonejeremiedbb
authored andcommitted
MAINT Parameter Validation for feature_selection.f_regression (scikit-learn#25736)
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
1 parent a00cd61 commit 93acdf2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

sklearn/feature_selection/_univariate_selection.py

Lines changed: 8 additions & 8000 ; 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,14 @@ def r_regression(X, y, *, center=True, force_finite=True):
334334
return correlation_coefficient
335335

336336

337+
@validate_params(
338+
{
339+
"X": ["array-like", "sparse matrix"],
340+
"y": ["array-like"],
341+
"center": ["boolean"],
342+
"force_finite": ["boolean"],
343+
}
344+
)
337345
def f_regression(X, y, *, center=True, force_finite=True):
338346
"""Univariate linear regression tests returning F-statistic and p-values.
339347

sklearn/tests/test_public_functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def _check_function_param_validation(
115115
"sklearn.feature_extraction.image.reconstruct_from_patches_2d",
116116
"sklearn.feature_selection.chi2",
117117
"sklearn.feature_selection.f_classif",
118+
"sklearn.feature_selection.f_regression",
118119
"sklearn.metrics.accuracy_score",
119120
"sklearn.metrics.auc",
120121
"sklearn.metrics.average_precision_score",

0 commit comments

Comments
 (0)
0