8000 MAINT Parameters validation for feature_selection.mutual_info_regression by hbenedek · Pull Request #25850 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions sklearn/feature_selection/_mutual_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,16 @@ def _estimate_mi(
return np.array(mi)


@validate_params(
{
"X": ["array-like", "sparse matrix"],
"y": ["array-like"],
"discrete_features": [StrOptions({"auto"}), "boolean", "array-like"],
"n_neighbors": [Interval(Integral, 1, None, closed="left")],
"copy": ["boolean"],
"random_state": ["random_state"],
}
)
def mutual_info_regression(
X, y, *, discrete_features="auto", n_neighbors=3, copy=True, random_state=None
):
Expand Down
1 change: 1 addition & 0 deletions sklearn/tests/test_public_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def _check_function_param_validation(
"sklearn.feature_selection.f_classif",
"sklearn.feature_selection.f_regression",
"sklearn.feature_selection.mutual_info_classif",
"sklearn.feature_selection.mutual_info_regression",
"sklearn.feature_selection.r_regression",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.auc",
Expand Down
0