Skip to content

Commit b46a918

Browse files
authored
Handle scenario when None is passed as memory limit (#1118)
1 parent c4bb832 commit b46a918

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

autosklearn/automl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ def fit(
814814

815815
@staticmethod
816816
def subsample_if_too_large(X, y, logger, seed, memory_limit, task):
817-
if isinstance(X, np.ndarray):
817+
if memory_limit and isinstance(X, np.ndarray):
818818
if X.dtype == np.float32:
819819
multiplier = 4
820820
elif X.dtype in (np.float64, np.float):

test/test_automl/test_automl.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -675,16 +675,16 @@ def test_fail_if_feat_type_on_pandas_input(backend, dask_client):
675675
[
676676
(memory_limit, task)
677677
for task in itertools.chain(CLASSIFICATION_TASKS, REGRESSION_TASKS)
678-
for memory_limit in (1, 10)
678+
for memory_limit in (1, 10, None)
679679
]
680680
)
681681
def test_subsample_if_too_large(memory_limit, task):
682682
fixture = {
683-
BINARY_CLASSIFICATION: {1: 436, 10: 569},
684-
MULTICLASS_CLASSIFICATION: {1: 204, 10: 1797},
685-
MULTILABEL_CLASSIFICATION: {1: 204, 10: 1797},
686-
REGRESSION: {1: 1310, 10: 1326},
687-
MULTIOUTPUT_REGRESSION: {1: 1310, 10: 1326}
683+
BINARY_CLASSIFICATION: {1: 436, 10: 569, None: 569},
684+
MULTICLASS_CLASSIFICATION: {1: 204, 10: 1797, None: 1797},
685+
MULTILABEL_CLASSIFICATION: {1: 204, 10: 1797, None: 1797},
686+
REGRESSION: {1: 1310, 10: 1326, None: 1326},
687+
MULTIOUTPUT_REGRESSION: {1: 1310, 10: 1326, None: 1326}
688688
}
689689
mock = unittest.mock.Mock()
690690
if task == BINARY_CLASSIFICATION:

0 commit comments

Comments
 (0)