hyperas
hyperas copied to clipboard
Retrieve actual values from Trial object
Hi, how is one supposed to retrieve the actual values from the Trial object e.g. to print/plot the information? For instance if I have the Dropout set by "choice" how can I display the actual value that is chosen at the moment instead of the index? I know that I can show the actual values of the best_run by adding the flag eval_space = True but how is that achievable with every single trial?
@bennyooo Iterating over the trials object gives you the information you want. It has the results dict from each trial and a bunch of extra trial information like what parameters are used.
```evals = 100
X_train,y_train,X_val,y_val,X_test,y_test = data()
trials = Trials() #This is important to instantiate before
best_run, best_model = optim.minimize(model=create_model, data=data,
functions = [process_data],
algo=tpe.suggest,max_evals=evals,trials=trials)
print("----------trials-------------")
for i in trials.trials:
vals = i.get('misc').get('vals')
results = i.get('result').get('loss')
print(vals,results)```