Skip to content
Projets

noahgift/mlflow-project-best-practices

Voir sur GitHub

À propos

An example MLFlow project

IA et apprentissage automatique

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
Historique en cours
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

mlflow-project-best-practices

An example MLFlow project

Python application test with Github Actions

High Level Architecture

end-to-end-mlops

You can Notebook see the Databricks code here: https://github.com/noahgift/mlflow-project-best-practices/blob/main/XGBoost-fake-news-automl.ipynb

Example in Azure CloudShell

predict

Example in Github Codespaces

Screen Shot 2022-03-12 at 7 11 31 PM

Curl Example

curl \
  -u token:$DATABRICKS_TOKEN \
  -X POST \
  -H "Content-Type: application/json; format=pandas-records" \
  [email protected] \
  https://adb-2951765055089996.16.azuredatabricks.net/model/Fake-News/1/invocations

Deploy Architecture

IMG_0217

Query registered model

Query with Databricks CLI

  1. Create a databricks config: touch ~/.databrickscfg
  2. Put in host and token
  3. Query jobs

databricks jobs list --output JSON | jq 4. List clusters

databricks clusters list --output JSON | jq

  1. List contents of DBFS

databricks fs ls dbfs:/

Query for Models with API

You need to set the tracking URI.

export MLFLOW_TRACKING_URI=databricks
from pprint import pprint
from mlflow.tracking import MlflowClient
client = MlflowClient()
for rm in client.list_registered_models():
  pprint(dict(rm), indent=4)

Download Model

CLI version

mlflow artifacts download --artifact-uri models:/<name>/<version|stage>

To use Python do the following:

from mlflow.store.artifact.models_artifact_repo import ModelsArtifactRepository

model_uri = MlflowClient.get_model_version_download_uri(model_name, model_version)
ModelsArtifactRepository(model_uri).download_artifacts(artifact_path="")

Register model for AWS Sagemaker

Screen Shot 2022-03-16 at 1 53 31 PM

Goal for today

  • Databricks Tensorflow run
  • Feature Store
  • Model Serving

Model Serving

https://docs.databricks.com/applications/mlflow/model-serving.html

Run it with mlserve

 mlflow models serve --model-uri  /workspaces/mlflow-project-best-practices/tf-model

References


Learn MLOps end to end: Machine Learning with Databricks and MLflow (Coursera) · MLOps specialization, Duke (Coursera) · Machine Learning Operations program (edX)

More courses from Noah Gift and Pragmatic AI Labs.

Explorer des projets similaires

Chargement…