Parametrized experiments#
Fixed and variable parameters#
Parametrized experiments allow you to control and differentiate the behaviour of runs:
-
Parameter grids are grids of parameters with a discrete number of values for each, can be set on
runsusingExperiment.add_runs(A=[1,2,...], B=...)and are accessible within therunatrun.params. -
Configuration parameters are fixed for all
runs, can be accessed atrun.configand are set by passingconfig={A=1, B=2, ...}toExperiment.execute. The value is the same for allruns.
In the next example:
-
We define a fixed configuration parameter
X. We use a parameter grid, similarly tosklearn.model_selection.ParameterGrid, to definerunparametersAandB. -
We execute the step function
step_sum, summing up the value ofA,BandX. -
We persist and query the experiment as a Pandas dataframe.
Creating an experiment
Tip
The attributes run.config and run.params are not persisted to database by default.
You can request its transparent persistence with Experiment.execute(...., args_field="args"),
which will persist/reload config/params to/from run.fields.args.
Congratulations!
You know how to define parameter grids and explore the impact of varying parameters on evaluation metrics.