MLflow community flavor and autologging for AutoGluon predictors
Project description
mlflow-autogluon
MLflow community model flavor and autologging for AutoGluon predictors.
Documentation: phylatech.github.io/mlflow-autogluon
AutoGluon has no built-in MLflow flavor, and the MLflow maintainers have asked for this integration to live as a community flavor (see mlflow/mlflow#13214 and autogluon/autogluon#1404). This package provides that integration:
- Model flavor:
save_model,log_model, andload_modelforTabularPredictor,TimeSeriesPredictor, andMultiModalPredictor, with full round-trip fidelity. - PyFunc support: logged models load with
mlflow.pyfunc.load_modeland serve withmlflow models serve, includingpredict_probavia inference params and long-format DataFrame forecasting for timeseries models. - Autologging: one call to
mlflow_autogluon.autolog()records params, leaderboard metrics, artifacts, and the fitted predictor for everyfitcall, across all installed predictor types.
Installation
pip install mlflow-autogluon[tabular]
Autologging quickstart
import mlflow_autogluon
from autogluon.tabular import TabularPredictor
mlflow_autogluon.autolog()
predictor = TabularPredictor(label="target").fit(train_data, presets="medium_quality")
That single autolog() call gives you, per fit:
| What | Examples |
|---|---|
| Params | label, problem_type, eval_metric, presets, time_limit, hyperparameters, train_rows |
| Metrics | best_model_score_val, fit_time_seconds, per-model score_val_* / fit_time_* |
| Tags | estimator_name, autogluon_version, best_model, problem_type |
| Artifacts | leaderboard.csv, optional fit_summary.json, the fitted model |
Because this is a community flavor, mlflow.autolog() does not enable it automatically;
call mlflow_autogluon.autolog() explicitly. Options:
mlflow_autogluon.autolog(
log_models=True, # log the fitted predictor as an MLflow model
log_leaderboard=True, # leaderboard CSV artifact + per-model metrics
log_fit_summary=False, # fit_summary() as a JSON artifact
registered_model_name=None, # also register logged models under this name
extra_tags=None, # extra tags applied to autologged runs
disable=False, # turn the integration off
)
Manual logging
import mlflow
import mlflow_autogluon
with mlflow.start_run():
model_info = mlflow_autogluon.log_model(
ag_model=predictor,
artifact_path="model",
input_example=train_data.drop(columns=["target"]).head(),
)
# Load back the native predictor
predictor = mlflow_autogluon.load_model(model_info.model_uri)
# Or load as a generic pyfunc for serving
pyfunc_model = mlflow.pyfunc.load_model(model_info.model_uri)
predictions = pyfunc_model.predict(test_data)
probabilities = pyfunc_model.predict(test_data, params={"predict_method": "predict_proba"})
Serving works out of the box:
mlflow models serve -m "models:/<name>/<version>" -p 5001
Compatibility
- Python >= 3.9 (CI: 3.10, 3.11, 3.12)
- MLflow >= 2.15 (CI: latest 3.x and the 2.x line)
- AutoGluon >= 1.1:
TabularPredictor([tabular]extra),TimeSeriesPredictor([timeseries]), andMultiModalPredictor([multimodal])
See examples/autolog_quickstart.py for a complete runnable walkthrough on a real dataset.
Roadmap
- Model signature inference during autologging
- ClearML integration (tracked separately)
Development
With pixi (recommended):
pixi install
pixi run test # tabular test suite
pixi run lint # ruff
pixi run docs # live documentation server
pixi run -e full coverage # full suite with the 100 percent gate
Or with conda/mamba via the shipped environment.yml:
mamba env create -f environment.yml
mamba run -n mlflow-autogluon pip install -e .
mamba run -n mlflow-autogluon pytest
See the contributing guide for the full task list and release process.
License
Apache License 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mlflow_autogluon-0.1.1.tar.gz.
File metadata
- Download URL: mlflow_autogluon-0.1.1.tar.gz
- Upload date:
- Size: 24.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f884984fdfff97efb9f161bcf07492b38174a5ad5895080e9fbf2633183464e
|
|
| MD5 |
b4315ada9fef17cf6eda4bb3be47a220
|
|
| BLAKE2b-256 |
88f250cc3ccbc2930ea861f0bd4a380e52ee52434ab138b015e1d9ed4fc9e392
|
Provenance
The following attestation bundles were made for mlflow_autogluon-0.1.1.tar.gz:
Publisher:
publish-pypi.yml on PhylaTech/mlflow-autogluon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mlflow_autogluon-0.1.1.tar.gz -
Subject digest:
4f884984fdfff97efb9f161bcf07492b38174a5ad5895080e9fbf2633183464e - Sigstore transparency entry: 2122799572
- Sigstore integration time:
-
Permalink:
PhylaTech/mlflow-autogluon@0b3123cd2e7b0bd26c1a1cb93db99d63d8ef20fb -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/PhylaTech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0b3123cd2e7b0bd26c1a1cb93db99d63d8ef20fb -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mlflow_autogluon-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mlflow_autogluon-0.1.1-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c4a5f00667769763188b0285fc0d365ea003add7a684cc76f7f084c9c2613ec
|
|
| MD5 |
ffe4941723ae3608b2b8021306507f5f
|
|
| BLAKE2b-256 |
dd18a0c2dc5482d2baf5f77488cd27880ee9e1c31de2183d1fa006ed2b1d1f8f
|
Provenance
The following attestation bundles were made for mlflow_autogluon-0.1.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on PhylaTech/mlflow-autogluon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mlflow_autogluon-0.1.1-py3-none-any.whl -
Subject digest:
3c4a5f00667769763188b0285fc0d365ea003add7a684cc76f7f084c9c2613ec - Sigstore transparency entry: 2122799643
- Sigstore integration time:
-
Permalink:
PhylaTech/mlflow-autogluon@0b3123cd2e7b0bd26c1a1cb93db99d63d8ef20fb -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/PhylaTech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0b3123cd2e7b0bd26c1a1cb93db99d63d8ef20fb -
Trigger Event:
workflow_dispatch
-
Statement type: