Exercise

Adding parameters to MLproject

Defining parameters in MLflow Projects allows you to make your ML code reproducible. Parameters also simplify running training experiments with different settings without having to change code.

In this exercise, you are going to add parameters to your MLproject file for the main entry point. This entry point is used to run the train_model.py script which trains a Logistic Regression model from Insurance data.

The script accepts two parameters, n_jobs and fit_intercept, which are hyperparameters used to train the model. You will begin by adding the n_jobs parameter in the MLproject file. You will then add the fit_intercept parameter. Finally, you will add the parameters to the command executed in the main entry point.

Instructions

100 XP
  • Create a parameter called n_jobs as a type int and a default value of 1.
  • Create a second parameter called fit_intercept as a type bool with a default value set to True.
  • Pass both parameters into the command ensuring that n_jobs is the first followed by fit_intercept.