Create a Run¶
In the context of MLflow, a "run" refers to a specific instance of an experiment. You can think of a "run" as a unique execution of an experiment, where specific configurations are applied, a model is trained with particular data, and results are recorded.
import mlflow
# Set the experiment name
experiment = mlflow.set_experiment("mlflow-demo")
# Start a new run
experiment_id = experiment.experiment_id
with mlflow.start_run(experiment_id=experiment_id) as run:
print(f"🎉 Run ID: {run.info.run_id}")
🎉 Run ID: ee728d1da7e84c6e939b464419d9b85a
What is a Run?¶
Every time you perform a test, adjust parameters, or use a specific dataset within your MLflow experiment, you are creating a new "run" within that experiment. Each "run" keeps a detailed record of how parameters were configured, which data was used, and what results were obtained in that particular execution. In MLflow you can see all the runs within an experiment and compare them to determine which one is the most effective based on performance metrics and results.
The ability to track and compare multiple "runs" within the same experiment is valuable because it allows you to explore different approaches and settings, record the details of each attempt, and determine which one is the most effective based on performance metrics and results. In summary, a "run" in MLflow is an individual instance of an experiment that helps you keep an accurate track of your tests and progress in your machine learning project.