Skip to content

Commit 42a7676

Browse files
committed
Addressing the constant training subset size in the test api
1 parent abeeaa4 commit 42a7676

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/test_api/test_api.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
from test.test_api.api_utils import print_debug_information # noqa E402
3838

39+
TRAINING_SUBSET_SIZE = 200
40+
3941

4042
# Fixtures
4143
# ========
@@ -53,7 +55,7 @@ def test_tabular_classification(openml_id, resampling_strategy, backend):
5355
data_id=int(openml_id),
5456
return_X_y=True, as_frame=True
5557
)
56-
X, y = X[:200], y[:200]
58+
X, y = X[:TRAINING_SUBSET_SIZE], y[:TRAINING_SUBSET_SIZE]
5759
X_train, X_test, y_train, y_test = sklearn.model_selection.train_test_split(
5860
X, y, random_state=1)
5961

@@ -216,7 +218,7 @@ def test_tabular_regression(openml_name, resampling_strategy, backend):
216218
return_X_y=True,
217219
as_frame=True
218220
)
219-
X, y = X[:200], y[:200]
221+
X, y = X[:TRAINING_SUBSET_SIZE], y[:TRAINING_SUBSET_SIZE]
220222
# normalize values
221223
y = (y - y.mean()) / y.std()
222224

@@ -480,7 +482,7 @@ def test_pipeline_fit(openml_id,
480482
data_id=int(openml_id),
481483
return_X_y=True, as_frame=True
482484
)
483-
X, y = X[:200], y[:200]
485+
X, y = X[:TRAINING_SUBSET_SIZE], y[:TRAINING_SUBSET_SIZE]
484486
X_train, X_test, y_train, y_test = sklearn.model_selection.train_test_split(
485487
X, y, random_state=1)
486488

0 commit comments

Comments
 (0)