diff --git a/sklearn/feature_selection/_univariate_selection.py b/sklearn/feature_selection/_univariate_selection.py index dcde57753143c..1929daa8ae8c8 100644 --- a/sklearn/feature_selection/_univariate_selection.py +++ b/sklearn/feature_selection/_univariate_selection.py @@ -251,6 +251,14 @@ def chi2(X, y): return _chisquare(observed, expected) +@validate_params( + { + "X": ["array-like", "sparse matrix"], + "y": ["array-like"], + "center": ["boolean"], + "force_finite": ["boolean"], + } +) def r_regression(X, y, *, center=True, force_finite=True): """Compute Pearson's r for each features and the target. diff --git a/sklearn/tests/test_public_functions.py b/sklearn/tests/test_public_functions.py index 6725df81561d3..a49ae690b6653 100644 --- a/sklearn/tests/test_public_functions.py +++ b/sklearn/tests/test_public_functions.py @@ -116,6 +116,7 @@ def _check_function_param_validation( "sklearn.feature_selection.chi2", "sklearn.feature_selection.f_classif", "sklearn.feature_selection.f_regression", + "sklearn.feature_selection.r_regression", "sklearn.metrics.accuracy_score", "sklearn.metrics.auc", "sklearn.metrics.average_precision_score",