File tree 2 files changed +6
-3
lines changed 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ def search(
131
131
precision : int = 32 ,
132
132
disable_file_output : List = [],
133
133
load_models : bool = True ,
134
+ run_greedy_portfolio : bool = False
134
135
) -> 'BaseTask' :
135
136
"""
136
137
Search for the best pipeline configuration for the given dataset.
@@ -199,6 +200,8 @@ def search(
199
200
disable_file_output (Union[bool, List]):
200
201
load_models (bool), (default=True): Whether to load the
201
202
models after fitting AutoPyTorch.
203
+ run_greedy_portfolio (bool), (default=False): If True,
204
+ runs initial
202
205
203
206
Returns:
204
207
self
Original file line number Diff line number Diff line change 1
1
import copy
2
2
import json
3
3
import logging .handlers
4
+ import os
4
5
import typing
5
6
6
7
import ConfigSpace
@@ -210,8 +211,7 @@ def __init__(self,
210
211
self .logger .info ("initialised {}" .format (self .__class__ .__name__ ))
211
212
212
213
# read and validate initial configurations
213
- with open ('greedy_portfolio.json' , 'r' ) as fp :
214
- initial_configurations = json .load (fp )
214
+ initial_configurations = json .load (open (os .path .join (os .path .dirname (__file__ ), 'greedy_portfolio.json' )))
215
215
216
216
self .initial_configurations : typing .List [Configuration ] = list ()
217
217
for configuration_dict in initial_configurations :
@@ -220,7 +220,7 @@ def __init__(self,
220
220
self .initial_configurations .append (configuration )
221
221
except Exception as e :
222
222
self .logger .warning (f"Failed to convert { configuration_dict } into"
223
- f" a Configuration with error { e . msg [ 0 ] } . "
223
+ f" a Configuration with error { e } . "
224
224
f"Therefore, it can't be used as an initial "
225
225
f"configuration as it does not match the current config space. " )
226
226
You can’t perform that action at this time.
0 commit comments