Join the newly launched Discord
community for real-time discussions, peer support, and direct interaction with the Meridian team!
Module: meridian.mlflow.autolog
Stay organized with collections
Save and categorize content based on your preferences.
MLflow autologging integration for Meridian.
This module enables MLflow tracking for Meridian. When enabled via autolog()
,
parameters, metrics, and other metadata will be automatically logged to MLflow,
allowing for improved experiment tracking and analysis.
To enable MLflow autologging for your Meridian workflows, simply call autolog.autolog()
once before your model run.
Example usage:
import
mlflow
from
meridian.data
import
load
from
meridian.mlflow
import
autolog
from
meridian.model
import
model
# Enable autologging (call this once per session)
autolog
.
autolog
(
log_metrics
=
True
)
# Start an MLflow run (optionally name it for better grouping)
with
mlflow
.
start_run
(
run_name
=
"my_run"
):
# Load data
data
=
load
.
CsvDataLoader
(
...
)
.
load
()
# Initialize Meridian model
mmm
=
model
.
Meridian
(
input_data
=
data
)
# Run Meridian sampling processes
mmm
.
sample_prior
(
n_draws
=
100
,
seed
=
123
)
mmm
.
sample_posterior
(
n_chains
=
7
,
n_adapt
=
500
,
n_burnin
=
500
,
n_keep
=
1000
,
seed
=
1
)
# After the run completes, you can retrieve run results using the MLflow client.
client
=
mlflow
.
tracking
.
MlflowClient
()
# Get the experiment ID for the run you just launched
experiment_id
=
"0"
# Search for runs matching the run name
runs
=
client
.
search_runs
(
experiment_id
,
max_results
=
1000
,
filter_string
=
f
"attributes.run_name = 'my_run'"
)
# Print details of the run
if
runs
:
print
(
runs
[
0
])
else
:
print
(
"No runs found."
)
Functions
autolog(...)
: Enables MLflow tracking for Meridian.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-05 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-05 UTC."],[],[],null,["\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/google/meridian/blob/v1.2.0/meridian/mlflow/autolog.py) |\n\nMLflow autologging integration for Meridian.\n\nThis module enables MLflow tracking for Meridian. When enabled via `autolog()`,\nparameters, metrics, and other metadata will be automatically logged to MLflow,\nallowing for improved experiment tracking and analysis.\n\nTo enable MLflow autologging for your Meridian workflows, simply call\n[`autolog.autolog()`](../../meridian/mlflow/autolog/autolog.md) once before your model run.\n\nExample usage: \n\n import mlflow\n from meridian.data import load\n from meridian.mlflow import autolog\n from meridian.model import model\n\n # Enable autologging (call this once per session)\n autolog.autolog(log_metrics=True)\n\n # Start an MLflow run (optionally name it for better grouping)\n with mlflow.start_run(run_name=\"my_run\"):\n # Load data\n data = load.CsvDataLoader(...).load()\n\n # Initialize Meridian model\n mmm = model.Meridian(input_data=data)\n\n # Run Meridian sampling processes\n mmm.sample_prior(n_draws=100, seed=123)\n mmm.sample_posterior(n_chains=7, n_adapt=500, n_burnin=500, n_keep=1000,\n seed=1)\n\n # After the run completes, you can retrieve run results using the MLflow client.\n client = mlflow.tracking.MlflowClient()\n\n # Get the experiment ID for the run you just launched\n experiment_id = \"0\"\n\n # Search for runs matching the run name\n runs = client.search_runs(\n experiment_id,\n max_results=1000,\n filter_string=f\"attributes.run_name = 'my_run'\"\n )\n\n # Print details of the run\n if runs:\n print(runs[0])\n else:\n print(\"No runs found.\")\n\nFunctions\n\n[`autolog(...)`](../../meridian/mlflow/autolog/autolog.md): Enables MLflow tracking for Meridian."]]