Skip to content

Commit 2a2d2ad

Browse files
committed
MAINT make each example run 120 seconds
1 parent e952b51 commit 2a2d2ad

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

autosklearn/automl.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,20 @@ def _fit(self, datamanager):
376376
"left.")
377377
self._proc_smac = None
378378
else:
379+
if self._per_run_time_limit is None or \
380+
self._per_run_time_limit > time_left_for_smac:
381+
print('Time limit for a single run is higher than total time '
382+
'limit. Capping the limit for a single run to the total '
383+
'time given to SMAC (%f)' % time_left_for_smac)
384+
per_run_time_limit = time_left_for_smac
385+
else:
386+
per_run_time_limit = self._per_run_time_limit
387+
379388
self._proc_smac = AutoMLSMBO(config_space=self.configuration_space,
380389
dataset_name=self._dataset_name,
381390
backend=self._backend,
382391
total_walltime_limit=time_left_for_smac,
383-
func_eval_time_limit=self._per_run_time_limit,
392+
func_eval_time_limit=per_run_time_limit,
384393
memory_limit=self._ml_memory_limit,
385394
data_memory_limit=self._data_memory_limit,
386395
watcher=self._stopwatch,

example/example_crossvalidation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def main():
1818
X_test = X[1000:]
1919
y_test = y[1000:]
2020
automl = autosklearn.classification.AutoSklearnClassifier(
21-
time_left_for_this_task=60, per_run_time_limit=30,
21+
time_left_for_this_task=120, per_run_time_limit=30,
2222
tmp_folder='/tmp/autoslearn_cv_example_tmp',
2323
output_folder='/tmp/autosklearn_cv_example_out',
2424
delete_tmp_folder_after_terminate=False,

example/example_parallel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def spawn_classifier(seed, dataset_name):
3535
# models.
3636
# 3. all instances of the AutoSklearnClassifier must have a different seed!
3737
automl = AutoSklearnClassifier(
38-
time_left_for_this_task=180, # sec., how long should this seed fit process run
38+
time_left_for_this_task=120, # sec., how long should this seed fit
39+
# process run
3940
per_run_time_limit=60, # sec., each model may only take this long before it's killed
4041
ml_memory_limit=1024, # MB, memory limit imposed on each call to a ML algorithm
4142
shared_mode=True, # tmp folder will be shared between seeds

example/example_regression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def main():
1414
np.random.shuffle(indices)
1515
X_train, X_test, y_train, y_test = train_test_split(X, y)
1616
automl = autosklearn.regression.AutoSklearnRegressor(
17-
time_left_for_this_task=600,
17+
time_left_for_this_task=120, per_run_time_limit=30,
1818
tmp_folder='/tmp/autoslearn_regression_example_tmp',
1919
output_folder='/tmp/autosklearn_regression_example_out')
2020
automl.fit(X_train, y_train, dataset_name='boston')

0 commit comments

Comments
 (0)