Creating an MLproject for the ML Lifecycle: Model Engineering
The MLproject
file can include more than one entry point. This means that you can use a single MLproject
file to execute multiple entry points, making it possible to execute a workflow of multiple steps using a single MLproject
file.
In this exercise you are going to build the beginning of an MLproject
file that contains the model_engineering
entry point. This entry point will execute a python script that accepts parameters used as hyperparameter values for fit_intercept
and n_jobs
to a Logistic Regression model. This model is used to predict sex of person from an insurance claim.
This exercise is part of the course
Introduction to MLflow
Exercise instructions
- Create an entry point for the Model Engineering step of the ML lifecycle called
model_engineering
. - Set the first entry point parameter to
n_jobs
and and second tofit_intercept
. - Place the parameters within the command.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
"""
name: insurance_model
python_env: python_env.yaml
entry_points:
# Set the entry point
____:
parameters:
# Set n_jobs
____:
type: int
default: 1
# Set fit_intercept
____:
type: bool
default: True
# Pass the parameters to the command
command: "python3.9 train_model.py {____} {____}"
"""