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 55cb632

Browse filesBrowse files
Théophile Barangerjeremiedbb
Théophile Baranger
andauthored
MAINT Parameters validation for datasets.make_regression (#25899)
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
1 parent 72b040a commit 55cb632
Copy full SHA for 55cb632

File tree

2 files changed

+16
-0
lines changed
Filter options

2 files changed

+16
-0
lines changed

‎sklearn/datasets/_samples_generator.py

Copy file name to clipboardExpand all lines: sklearn/datasets/_samples_generator.py
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,21 @@ def make_hastie_10_2(n_samples=12000, *, random_state=None):
523523
return X, y
524524

525525

526+
@validate_params(
527+
{
528+
"n_samples": [Interval(Integral, 1, None, closed="left")],
529+
"n_features": [Interval(Integral, 1, None, closed="left")],
530+
"n_informative": [Interval(Integral, 0, None, closed="left")],
531+
"n_targets": [Interval(Integral, 1, None, closed="left")],
532+
"bias": [Interval(Real, None, None, closed="neither")],
533+
"effective_rank": [Interval(Integral, 1, None, closed="left"), None],
534+
"tail_strength": [Interval(Real, 0, 1, closed="both")],
535+
"noise": [Interval(Real, 0, None, closed="left")],
536+
"shuffle": ["boolean"],
537+
"coef": ["boolean"],
538+
"random_state": ["random_state"],
539+
}
540+
)
526541
def make_regression(
527542
n_samples=100,
528543
n_features=100,

‎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
@@ -133,6 +133,7 @@ def _check_function_param_validation(
133133
"sklearn.datasets.make_classification",
134134
"sklearn.datasets.make_friedman1",
135135
"sklearn.datasets.make_low_rank_matrix",
136+
"sklearn.datasets.make_regression",
136137
"sklearn.datasets.make_sparse_coded_signal",
137138
"sklearn.decomposition.sparse_encode",
138139
"sklearn.feature_extraction.grid_to_graph",

0 commit comments

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