Wrap Up Experiment

After you've run the optimization loop for the suggested number of iterations, it's time to wrap up your Experiment. You'll want to find the assignments with the best value of your metric, known as the best_assignments. You can do this through the API via the Best Assignments object. The code snippet below shows you how to find the parameter assignments that produced the best value:

best_assignments_list = (
    conn.experiments(EXPERIMENT_ID)
        .best_assignments()
        .fetch()
)
if best_assignments_list.data:
    best_assignments = best_assignments_list.data[0].assignments