Skip to content

Commit

Permalink
Log schema along with model
Browse files Browse the repository at this point in the history
  • Loading branch information
BenGalewsky committed Oct 4, 2022
1 parent e0d3502 commit 5980504
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/sklearn_elasticnet_wine/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import logging

from mlflow.models import infer_signature

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -82,6 +84,9 @@ def eval_metrics(actual, pred):
# There are other ways to use the Model Registry, which depends on the use case,
# please refer to the doc for more information:
# https://mlflow.org/docs/latest/model-registry.html#api-workflow
mlflow.sklearn.log_model(lr, "model", registered_model_name="ElasticnetWineModel")
signature = infer_signature(data, predicted_qualities)

mlflow.sklearn.log_model(lr, "model", signature=signature,
registered_model_name="ElasticnetWineModel")
else:
mlflow.sklearn.log_model(lr, "model")

0 comments on commit 5980504

Please sign in to comment.