Complete the code to save a model version using MLflow.
mlflow.sklearn.log_model(model, '[1]')
The artifact_path is where the model is saved in MLflow. This helps track versions.
Complete the code to load a specific model version for rollback.
model = mlflow.pyfunc.load_model('models:/[1]/1')
The model_name is used in the model registry URI to specify which model to load.
Fix the error in the code to rollback to a previous model version.
mlflow.register_model('models:/my_model/[1]', 'my_model')
To rollback, specify the exact version number like '1' to register that version.
Fill both blanks to update the model stage to enable rollback.
client.transition_model_version_stage(name='my_model', version=[1], stage='[2]')
Version '1' is moved to 'Production' stage to rollback to that version.
Fill all three blanks to create a dictionary mapping model versions to stages for rollback.
version_stages = [1]: '[2]', [3]: 'Archived'}
This dictionary maps version 1 to Production and version 2 to Archived, enabling rollback management.