Adding parameters to project run
Parameters can be used to configure the behavior of a model by being passed as variables to the model during training. This allows you to train the model several times using different parameters without modifying the training code itself.
In this exercise, you will use the mlflow projects
module to run a Project used to train a Logistic Regression model for your Insurance experiment. You will create code using the mlflow projects
module that will run your project. You will then add parameters that will be passed as hyperparameters to the model during training.
This exercise is part of the course
Introduction to MLflow
Exercise instructions
- Call
mlflow.projects.run()
function from themlflow projects
module. - Create the parameters dictionary and set
n_jobs_param
to 2 andfit_intercept_param
toFalse
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
import mlflow
# Set the run function from the MLflow Projects module
____.____.____(
uri='./',
entry_point='main',
experiment_name='Insurance',
env_manager='local',
# Set parameters for n_jobs and fit_intercept
____={
'____': ____,
'____': ____
}
)