Skip to content

Instantly share code, notes, and snippets.

@IvanNardini
Created June 7, 2020 11:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IvanNardini/774c99279abdac2988f8f84e82fde7d3 to your computer and use it in GitHub Desktop.
Save IvanNardini/774c99279abdac2988f8f84e82fde7d3 to your computer and use it in GitHub Desktop.
MLOps series #2 : Deploy a Recommendation System as Hosted Interactive Web Service on AWS
model_name = 'Champion'
artifact_path = "model"
model_uri = "runs:/{run_id}/{artifact_path}".format(run_id=run_id, artifact_path=artifact_path)
model_details = mlflow.register_model(model_uri=model_uri, name=model_name)
client = MlflowClient()
client.update_registered_model(
name=model_details.name,
description="This model provides recommendation for specific users and items based on purchase data. The data consists of user transactions"
)
client.update_model_version(
name=model_details.name,
version=model_details.version,
description="This model was built with Surprise library. It is a ALS based BaselineOnly algorithm"
)
client.transition_model_version_stage(
name=model_details.name,
version=model_details.version,
stage='Staging',
)
model_version_details = client.get_model_version(
name=model_details.name,
version=model_details.version,
)
print("The current model stage is: '{stage}'".format(stage=model_version_details.current_stage))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment