@@ -56,6 +56,9 @@ class TabularClassificationTask(BaseTask):
56
56
If None, all possible components are used. Otherwise
57
57
specifies set of components not to use. Incompatible
58
58
with include components
59
+ search_space_updates (Optional[HyperparameterSearchSpaceUpdates]):
60
+ search space updates that can be used to modify the search
61
+ space of particular components or choice modules of the pipeline
59
62
"""
60
63
def __init__ (
61
64
self ,
@@ -119,6 +122,7 @@ def search(
119
122
precision : int = 32 ,
120
123
disable_file_output : List = [],
121
124
load_models : bool = True ,
125
+ portfolio_selection : Optional [str ] = None ,
122
126
) -> 'BaseTask' :
123
127
"""
124
128
Search for the best pipeline configuration for the given dataset.
@@ -131,21 +135,21 @@ def search(
131
135
A pair of features (X_train) and targets (y_train) used to fit a
132
136
pipeline. Additionally, a holdout of this pairs (X_test, y_test) can
133
137
be provided to track the generalization performance of each stage.
134
- optimize_metric (str): name of the metric that is used to
135
- evaluate a pipeline.
138
+ optimize_metric (str):
139
+ name of the metric that is used to evaluate a pipeline.
136
140
budget_type (Optional[str]):
137
141
Type of budget to be used when fitting the pipeline.
138
142
Either 'epochs' or 'runtime'. If not provided, uses
139
143
the default in the pipeline config ('epochs')
140
144
budget (Optional[float]):
141
145
Budget to fit a single run of the pipeline. If not
142
146
provided, uses the default in the pipeline config
143
- total_walltime_limit (int), (default=100): Time limit
144
- in seconds for the search of appropriate models.
147
+ total_walltime_limit (int), (default=100):
148
+ Time limit in seconds for the search of appropriate models.
145
149
By increasing this value, autopytorch has a higher
146
150
chance of finding better models.
147
- func_eval_time_limit_secs (int), (default=None): Time limit
148
- for a single call to the machine learning model.
151
+ func_eval_time_limit_secs (int), (default=None):
152
+ Time limit for a single call to the machine learning model.
149
153
Model fitting will be terminated if the machine
150
154
learning algorithm runs over the time limit. Set
151
155
this value high enough so that typical machine
@@ -162,32 +166,40 @@ def search(
162
166
feature by turning this flag to False. All machine learning
163
167
algorithms that are fitted during search() are considered for
164
168
ensemble building.
165
- memory_limit (Optional[int]), (default=4096): Memory
166
- limit in MB for the machine learning algorithm. autopytorch
169
+ memory_limit (Optional[int]), (default=4096):
170
+ Memory limit in MB for the machine learning algorithm. autopytorch
167
171
will stop fitting the machine learning algorithm if it tries
168
172
to allocate more than memory_limit MB. If None is provided,
169
173
no memory limit is set. In case of multi-processing, memory_limit
170
174
will be per job. This memory limit also applies to the ensemble
171
175
creation process.
172
- smac_scenario_args (Optional[Dict]): Additional arguments inserted
173
- into the scenario of SMAC. See the
176
+ smac_scenario_args (Optional[Dict]):
177
+ Additional arguments inserted into the scenario of SMAC. See the
174
178
[SMAC documentation] (https://automl.github.io/SMAC3/master/options.html?highlight=scenario#scenario)
175
- get_smac_object_callback (Optional[Callable]): Callback function
176
- to create an object of class
179
+ get_smac_object_callback (Optional[Callable]):
180
+ Callback function to create an object of class
177
181
[smac.optimizer.smbo.SMBO](https://automl.github.io/SMAC3/master/apidoc/smac.optimizer.smbo.html).
178
182
The function must accept the arguments scenario_dict,
179
183
instances, num_params, runhistory, seed and ta. This is
180
184
an advanced feature. Use only if you are familiar with
181
185
[SMAC](https://automl.github.io/SMAC3/master/index.html).
182
- all_supported_metrics (bool), (default=True): if True, all
183
- metrics supporting current task will be calculated
186
+ all_supported_metrics (bool), (default=True):
187
+ if True, all metrics supporting current task will be calculated
184
188
for each pipeline and results will be available via cv_results
185
189
precision (int), (default=32): Numeric precision used when loading
186
190
ensemble data. Can be either '16', '32' or '64'.
187
191
disable_file_output (Union[bool, List]):
188
- load_models (bool), (default=True): Whether to load the
189
- models after fitting AutoPyTorch.
190
-
192
+ load_models (bool), (default=True):
193
+ Whether to load the models after fitting AutoPyTorch.
194
+ portfolio_selection (str), (default=None):
195
+ This argument controls the initial configurations that
196
+ AutoPyTorch uses to warm start SMAC for hyperparameter
197
+ optimization. By default, no warm-starting happens.
198
+ The user can provide a path to a json file containing
199
+ configurations, similar to (...herepathtogreedy...).
200
+ Additionally, the keyword 'greedy' is supported,
201
+ which would use the default portfolio from
202
+ `AutoPyTorch Tabular <https://arxiv.org/abs/2006.13799>`
191
203
Returns:
192
204
self
193
205
@@ -233,6 +245,7 @@ def search(
233
245
precision = precision ,
234
246
disable_file_output = disable_file_output ,
235
247
load_models = load_models ,
248
+ portfolio_selection = portfolio_selection ,
236
249
)
237
250
238
251
def predict (
0 commit comments