Running multiple batches of an experiment with different hyperparameter flag values

I am trying to utilize the grid search capability of guild to run an experiment multiple times with different hyperparameter flag values in a python file for SVM on the iris dataset.

My hyperparameter flags are defined as a dictionary:
hyperparam_dict = {‘kernel’: ‘linear’, ‘test_split’: 0.1, ‘random_seed’: 2, ‘degree’: 4, ‘gamma’: 50} and I want to be able to run the experiment with various values for each hyperparameter to test the accuracy value of every combination of flag values… e.g ‘test_split’ = [0.1, 0.2, 0.3], ‘degree’= [1, 2, 3, 4], etc.

When I follow the example from the get-started.ipynb:
_ = guild.run(train, x=[-0.5,-0.4,-0.3,-0.2,-0.1])
with my code:
guild.run(main, hyperparam_dict[‘test_split’] = [0.1, 0.2, 0.3],) I am getting an error.

Is there any way what I am trying to achieve, be done??

Looking for any help to try and resolve this issue!

Thank you.

Original guild.yml file:
image

Notebook commands where I am trying to achieve running multiple runs of an experiment with three different 'test_split" values to be tested.

You should update the dict value before you call guild.run, i.e.

hyperparm_dict['test_split'] = [.5, .4, .3]
guild.run(main, **hyperparam_dict)
1 Like

You can also use this syntax:

guild.run(main, test_split=[0.5, 0.4, 0.3], **hyperparam_dict)

Thank you both for the reply, I was able to fix the issue and it is working properly now. The solution that worked ended up being updating the dictionary within the guild.yml file before the guild.run command is executed.