Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Reproducible Packaging with MLflow Projects

An MLflow Project is a convention for organizing and describing your code to let other data scientists (or automated tools) run it.

1. The MLproject File

The core of a project is the MLproject file, which defines dependencies and entry points.

# Example MLproject content:
"""
name: My ML Project

conda_env: conda.yaml

entry_points:
  main:
    parameters:
      alpha: {type: float, default: 0.1}
      l1_ratio: {type: float, default: 0.1}
    command: "python train.py --alpha {alpha} --l1_ratio {l1_ratio}"
"""

2. Running a Project

You can run an MLflow project from a local directory or directly from GitHub.

import mlflow

# Run a project from a GitHub URI
# mlflow.run("https://github.com/mlflow/mlflow-example", parameters={"alpha": 0.5})