@@ -107,6 +107,8 @@ def parse_args(argv):
107107 opt_params .add_argument ("-d" , "--disable_fanova" , action = "store_true" , default = False ,
108108 help = "disables fANOVA" )
109109
110+ opt_params .add_argument ("-m" , "--memlimit_fanova" , default = 512 ,
111+ help = "sets memory limit in MB for fANOVA" )
110112
111113 # Process arguments
112114 args = parser .parse_args (argv [1 :])
@@ -149,8 +151,8 @@ def analyze_simulations(args):
149151 "Most likely you did not run SpySMAC_run with --seed 0." )
150152
151153 tmp = obj .data [0 ]['test_performances' ]
152- baseline_train = np .array ([tmp [j ] for j in train_indices ]).flatten ()
153- baseline_test = np .array ([tmp [j ] for j in test_indices ]).flatten ()
154+ baseline_train = np .array ([list ( tmp [j ]) for j in train_indices ]).flatten ()
155+ baseline_test = np .array ([list ( tmp [j ]) for j in test_indices ]).flatten ()
154156
155157
156158 # import the data for the configuration runs
@@ -163,14 +165,13 @@ def analyze_simulations(args):
163165 # get performance for each run
164166 for i in list (obj .data .keys ()):
165167 tmp = obj .data [i ]['test_performances' ]
166- tmp_train = np .array ([tmp [j ] for j in train_indices ]).flatten ()
167- tmp_test = np .array ([tmp [j ] for j in test_indices ]).flatten ()
168168
169+ tmp_train = np .array ([list (tmp [j ]) for j in train_indices ]).flatten ()
170+ tmp_test = np .array ([list (tmp [j ]) for j in test_indices ]).flatten ()
169171 run_ids .append (i )
170172 train_performances .append (tmp_train )
171173 test_performances .append (tmp_test )
172174
173-
174175 # each ROW contains the measured performance for the instances
175176 train_performances = np .array (train_performances )
176177 test_performances = np .array (test_performances )
@@ -216,15 +217,15 @@ def analyze_simulations(args):
216217
217218 # fANOVA
218219 try :
219- p_not_imps , fanova_not_plots = get_fanova (obj .get_pyfanova_obj (check_scenario_files = False , improvement_over = "NOTHING" ),
220+ p_not_imps , fanova_not_plots = get_fanova (obj .get_pyfanova_obj (check_scenario_files = False , improvement_over = "NOTHING" , heap_size = options [ 'memlimit_fanova' ] ),
220221 cs , options ['outputdir' ], improvement_over = "NOTHING" )
221222 except :
222223 traceback .print_exc ()
223224 logging .warn ("fANOVA (without capping) failed" )
224225 p_not_imps , fanova_not_plots = [],[]
225226
226227 try :
227- p_def_imps , fanova_def_plots = get_fanova (obj .get_pyfanova_obj (check_scenario_files = False , improvement_over = "DEFAULT" ),
228+ p_def_imps , fanova_def_plots = get_fanova (obj .get_pyfanova_obj (check_scenario_files = False , improvement_over = "DEFAULT" , heap_size = options [ 'memlimit_fanova' ] ),
228229 cs , options ['outputdir' ], improvement_over = "DEFAULT" )
229230 except :
230231 traceback .print_exc ()
0 commit comments