Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 530dfc9

Browse filesBrowse files
authored
MAINT Parameters validation for feature_selection.mutual_info_regression (#25850)
1 parent a40da6d commit 530dfc9
Copy full SHA for 530dfc9

File tree

2 files changed

+11
-0
lines changed
Filter options

2 files changed

+11
-0
lines changed

‎sklearn/feature_selection/_mutual_info.py

Copy file name to clipboardExpand all lines: sklearn/feature_selection/_mutual_info.py
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,16 @@ def _estimate_mi(
311311
return np.array(mi)
312312

313313

314+
@validate_params(
315+
{
316+
"X": ["array-like", "sparse matrix"],
317+
"y": ["array-like"],
318+
"discrete_features": [StrOptions({"auto"}), "boolean", "array-like"],
319+
"n_neighbors": [Interval(Integral, 1, None, closed="left")],
320+
"copy": ["boolean"],
321+
"random_state": ["random_state"],
322+
}
323+
)
314324
def mutual_info_regression(
315325
X, y, *, discrete_features="auto", n_neighbors=3, copy=True, random_state=None
316326
):

‎sklearn/tests/test_public_functions.py

Copy file name to clipboardExpand all lines: sklearn/tests/test_public_functions.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def _check_function_param_validation(
125125
"sklearn.feature_selection.f_classif",
126126
"sklearn.feature_selection.f_regression",
127127
"sklearn.feature_selection.mutual_info_classif",
128+
"sklearn.feature_selection.mutual_info_regression",
128129
"sklearn.feature_selection.r_regression",
129130
"sklearn.linear_model.orthogonal_mp",
130131
"sklearn.metrics.accuracy_score",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.