Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2161d11

Browse files
MAINT Parameters validation for feature_selection.r_regression (#25734)
Co-authored-by: Jérémie du Boisberranger <[email protected]>
1 parent 69e2d8a commit 2161d11

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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,14 @@ def chi2(X, y):
251251
return _chisquare(observed, expected)
252252

253253

254+
@validate_params(
255+
{
256+
"X": ["array-like", "sparse matrix"],
257+
"y": ["array-like"],
258+
"center": ["boolean"],
259+
"force_finite": ["boolean"],
260+
}
261+
)
254262
def r_regression(X, y, *, center=True, force_finite=True):
255263
"""Compute Pearson's r for each features and the target.
256264

sklearn/tests/test_public_functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def _check_function_param_validation(
116116
"sklearn.feature_selection.chi2",
117117
"sklearn.feature_selection.f_classif",
118118
"sklearn.feature_selection.f_regression",
119+
"sklearn.feature_selection.r_regression",
119120
"sklearn.metrics.accuracy_score",
120121
"sklearn.metrics.auc",
121122
"sklearn.metrics.average_precision_score",

0 commit comments

Comments
 (0)