Installation
mlflow>=2.1.1,<4- MLflow tracking and modelsnumpy- Numerical computing (MLflow dependency)pandas- Data manipulation (MLflow dependency)
Available Components
The MLflow integration provides these stack components:MLflow Experiment Tracker
Track experiments, metrics, and parameters
MLflow Model Registry
Manage model versions and lifecycle
MLflow Model Deployer
Deploy models as REST endpoints
MLflow Experiment Tracker
Track experiments and log metrics, parameters, and artifacts to MLflow.Configuration
Local Tracking:tracking_uri- MLflow tracking server URL (default: uses artifact store)tracking_username- Username for authenticationtracking_password- Password for authenticationtracking_token- Token for authentication (alternative to username/password)tracking_insecure_tls- Skip TLS verification (default:False)databricks_host- Databricks workspace URL (whentracking_uri=databricks)experiment_name- Default experiment name
Usage in Steps
Autologging (Recommended):Experiment Organization
Set Experiment Name:Supported Frameworks
MLflow autologging supports:- scikit-learn:
mlflow.sklearn.autolog() - TensorFlow/Keras:
mlflow.tensorflow.autolog()/mlflow.keras.autolog() - PyTorch:
mlflow.pytorch.autolog() - XGBoost:
mlflow.xgboost.autolog() - LightGBM:
mlflow.lightgbm.autolog() - Spark ML:
mlflow.spark.autolog() - Fastai:
mlflow.fastai.autolog()
MLflow Model Registry
Manage model versions and lifecycle stages.Configuration
registry_uri is not specified, uses the same URI as the experiment tracker.
Registering Models
Managing Model Versions
Model Stages
- None: Default stage
- Staging: For testing
- Production: Currently deployed
- Archived: Deprecated versions
MLflow Model Deployer
Deploy models as local REST endpoints.Configuration
Deploying Models
Making Predictions
Complete Stack Example
Setting Up MLflow Server
Local Development:Best Practices
Use Autologging
Use Autologging
Enable autologging for automatic metric capture:
Organize with Experiments and Tags
Organize with Experiments and Tags
Log Model Signatures
Log Model Signatures
Include model signatures for validation:
Use Remote Artifact Storage
Use Remote Artifact Storage
Store artifacts in cloud storage for scalability:
Common Issues
Connection Refused
Connection Refused
If you can’t connect to MLflow server:
- Verify server is running:
curl http://localhost:5000 - Check
tracking_uriis correct - Verify firewall rules
- Check authentication credentials
Artifact Upload Fails
Artifact Upload Fails
If artifact upload errors occur:
- Check artifact store permissions
- Verify S3/GCS credentials are configured
- Ensure artifact root path exists
- Check network connectivity to storage
Model Registration Fails
Model Registration Fails
If model registration doesn’t work:
- Verify model registry URI is set
- Check permissions for model registry
- Ensure model name is valid
- Check MLflow version compatibility
Next Steps
W&B Integration
Compare with Weights & Biases tracking
Experiment Tracking
Learn more about experiment tracking
Model Registry
Manage model lifecycle
MLflow Docs
Official MLflow documentation
