diff --git a/sklearn/feature_selection/_univariate_selection.py b/sklearn/feature_selection/_univariate_selection.py index 5521a62649c81..2868cf06ae02e 100644 --- a/sklearn/feature_selection/_univariate_selection.py +++ b/sklearn/feature_selection/_univariate_selection.py @@ -117,6 +117,12 @@ def f_oneway(*args): return f, prob +@validate_params( + { + "X": ["array-like", "sparse matrix"], + "y": ["array-like"], + } +) def f_classif(X, y): """Compute the ANOVA F-value for the provided sample. @@ -127,7 +133,7 @@ def f_classif(X, y): X : {array-like, sparse matrix} of shape (n_samples, n_features) The set of regressors that will be tested sequentially. - y : ndarray of shape (n_samples,) + y : array-like of shape (n_samples,) The target vector. Returns diff --git a/sklearn/tests/test_public_functions.py b/sklearn/tests/test_public_functions.py index 4fe337e9a95ea..aa705c1599582 100644 --- a/sklearn/tests/test_public_functions.py +++ b/sklearn/tests/test_public_functions.py @@ -113,6 +113,7 @@ def _check_function_param_validation( "sklearn.feature_extraction.image.extract_patches_2d", "sklearn.feature_extraction.image.reconstruct_from_patches_2d", "sklearn.feature_selection.chi2", + "sklearn.feature_selection.f_classif", "sklearn.metrics.accuracy_score", "sklearn.metrics.auc", "sklearn.metrics.average_precision_score",