Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions autosklearn/experimental/askl2.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ class AutoSklearn2Classifier(AutoSklearnClassifier):
def __init__(
self,
time_left_for_this_task: int = 3600,
per_run_time_limit=None,
ensemble_size: int = 50,
ensemble_nbest: Union[float, int] = 50,
max_models_on_disc: int = 50,
Expand Down Expand Up @@ -190,6 +191,13 @@ def __init__(
models. By increasing this value, *auto-sklearn* has a higher
chance of finding better models.

per_run_time_limit : int, optional (default=1/10 of time_left_for_this_task)
Time limit for a single call to the machine learning model.
Model fitting will be terminated if the machine learning
algorithm runs over the time limit. Set this value high enough so
that typical machine learning algorithms can be fit on the
training data.

ensemble_size : int, optional (default=50)
Number of models added to the ensemble built by *Ensemble
selection from libraries of models*. Models are drawn with
Expand Down Expand Up @@ -302,6 +310,7 @@ def __init__(
include_preprocessors = ["no_preprocessing"]
super().__init__(
time_left_for_this_task=time_left_for_this_task,
per_run_time_limit=per_run_time_limit,
initial_configurations_via_metalearning=0,
ensemble_size=ensemble_size,
ensemble_nbest=ensemble_nbest,
Expand Down
19 changes: 19 additions & 0 deletions test/test_automl/test_estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,3 +685,22 @@ def test_selector_file_askl2_can_be_created(selector_path):
assert selector_path in str(autosklearn.experimental.askl2.selector_file)
# Re import it at the end so we do not affect other test
importlib.reload(autosklearn.experimental.askl2)


def test_check_askl2_same_arguments_as_askl():
# In case a new attribute is created, make sure it is there also in
# ASKL2
extra_arguments = list(set(
inspect.getfullargspec(AutoSklearnEstimator.__init__).args) - set(
inspect.getfullargspec(AutoSklearn2Classifier.__init__).args))
expected_extra_args = ['exclude_estimators',
'include_preprocessors',
'resampling_strategy_arguments',
'exclude_preprocessors',
'include_estimators',
'get_smac_object_callback',
'initial_configurations_via_metalearning',
'resampling_strategy',
'metadata_directory']
unexpected_args = set(extra_arguments) - set(expected_extra_args)
assert len(unexpected_args) == 0, unexpected_args