8000 MAINT Parameters validation for sklearn.preprocessing.maxabs_scale (#… · scikit-learn/scikit-learn@8a1247d · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a1247d

Browse files
MAINT Parameters validation for sklearn.preprocessing.maxabs_scale (#26077)
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
1 parent 40e8c8e commit 8a1247d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

sklearn/preprocessing/_data.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,13 @@ def _more_tags(self):
12921292
return {"allow_nan": True}
12931293

12941294

1295+
@validate_params(
1296+
{
1297+
"X": ["array-like", "sparse matrix"],
1298+
"axis": [Options(Integral, {0, 1})],
1299+
"copy": ["boolean"],
1300+
}
1301+
)
12951302
def maxabs_scale(X, *, axis=0, copy=True):
12961303
"""Scale each feature to the [-1, 1] range without breaking the sparsity.
12971304
@@ -1306,7 +1313,7 @@ def maxabs_scale(X, *, axis=0, copy=True):
13061313
X : {array-like, sparse matrix} of shape (n_samples, n_features)
13071314
The data.
13081315
1309-
axis : int, default=0
1316+
axis : {0, 1}, default=0
13101317
Axis used to scale along. If 0, independently scale each feature,
13111318
otherwise (if 1) scale each sample.
13121319

sklearn/tests/test_public_functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ def _check_function_param_validation(
224224
"sklearn.model_selection.train_test_split",
225225
"sklearn.preprocessing.add_dummy_feature",
226226
"sklearn.preprocessing.binarize",
227+
"sklearn.preprocessing.maxabs_scale",
227228
"sklearn.preprocessing.scale",
228229
"sklearn.random_projection.johnson_lindenstrauss_min_dim",
229230
"sklearn.svm.l1_min_c",

0 commit comments

Comments
 (0)
0