AGENT SKILL

Meridian 模型结果可视化

meridian-result-visualization

加载拟合好的 Meridian 模型并生成标准可视化报告:模型结果摘要。适用于用户想要加载已保存的模型并查看结果(模型性能、拟合度、健康状况)的场景。不用于运行预算优化(请使用 meridian-budget-optimization)或构建/拟合模型(请使用 meridian-model-building)。

适用职业数据分析师
License 许可
Apache-2.0
所属仓库
google/meridian
最近更新
2026-11-14
Stars
★ 1.6k
Forks
312

01 前言 Front Matter

name
meridian-result-visualization
description
Loads a fitted Meridian model and generates standard visualization reports: Model Results Summary. Use when the user wants to load a saved model and view results (model performance, fit, health). Don't use for running budget optimization (use meridian-budget-optimization) or building/fitting the model (use meridian-model-building).

02 资源文件 3

03 SKILL.md 正文

Meridian Result Visualization

A skill for loading a fitted Meridian model and generating standard visualization reports.

Core Workflow

Interactivity Checkpoint Rule

Throughout this workflow, you will encounter CRITICAL INTERACTIVE CHECKPOINTs. At each checkpoint, you MUST:

  1. Present the current proposed configurations, report paths, script path, or status to the user for approval.
  2. Ask the user if they are ready to proceed using the available user-interaction tool (e.g., ask_question), structured as a multiple-choice question. Do NOT use raw chat text.
  3. Wait for their response before proceeding.
    • MANDATORY: You MUST pause at every checkpoint regardless of the initial prompt instructions (even if the user request contains phrases like "run autonomously", "execute directly", "fix autonomously", etc.). The initial request does NOT bypass these interactive checkpoints.
    • Note: If the user replies to a checkpoint with a generic approval (e.g., "proceed", "do what you think is best"), proceed with the proposed defaults.

1. Initial Setup

  • Prompt the user for the path to the serialized model file (meridian_model.binpb by default).
  • Prompt the user for output paths for:
    • Model Results Summary report (results_summary.html by default).
  • Prompt the user for the desired path for the generated Python script.
  • Prompt the user for any optional configuration for the reports (e.g., date ranges for results summary).
  • CRITICAL INTERACTIVE CHECKPOINT: Present the gathered paths and configurations to the user and obtain confirmation before loading the model.

2. Add Model Loading Code

  • Use meridian_serde.load_meridian() to load the model.
  • See load_model.md for code template.
  • CRITICAL INTERACTIVE CHECKPOINT: Present the model load path configuration and proposed Python code snippet to the user, and obtain approval before continuing to specify health checks.

3. Add Post-Modeling Health Checks Code (Optional)

  • Use reviewer.ModelReviewer to run health checks and save to HTML.
  • Small / Test Models: If a model has fewer than 2 MCMC draws (e.g. test or mock models where R-hat computation requires >= 2 samples), catch ValueError or skip R-hat calculation gracefully so health check reports generate cleanly.
  • See health_check.md for code template.
  • CRITICAL INTERACTIVE CHECKPOINT: Present the proposed health check report path and code snippet to the user, and obtain approval before continuing to results summary configuration.

4. Add Model Results Summary Code

  • Use summarizer.Summarizer to generate the HTML results summary, applying any user-specified configuration (e.g., date ranges).
    • Date Range Auto-Clipping: If applying a user-specified date range falls outside the model's time coordinates, clip or adjust the date range to match the model's actual coordinates.
    • Tip for errors: If you encounter errors regarding sample_prior, bypass or fix the requirement (for example, by setting sample_prior=False or passing the required parameters) to ensure successful generation.
  • See results_summary.md for code template.
  • CRITICAL INTERACTIVE CHECKPOINT: Present the proposed date ranges, output path configuration, and code snippet for the results summary to the user, and obtain approval before proceeding to script generation and execution.

5. Pre-execution Checkpoint

  • CRITICAL INTERACTIVE CHECKPOINT: Present the final report path and script path to the user, and ask for final confirmation to execute the results generation script now.

6. Execution & Script Setup

  • Write the accumulated Python script to the user-specified path. If your file-writing tool can ask the user to review the written file, don't request that review: the pre-execution checkpoint already asks for approval, and an extra prompt pauses the workflow.
  • Execute the script with the Python interpreter of the environment where google-meridian is installed: the one the user named; else python3 if a virtual environment is already active (VIRTUAL_ENV or CONDA_PREFIX is set); else the project directory's virtual environment (.venv/ or venv/, e.g., .venv/bin/python3) if there is one; else python3. If import meridian fails, ask the user which environment to use instead of searching the machine or installing packages unprompted.
  • CRITICAL: Do NOT delete the generated reports, the script, or the output directory at the end of the task. These are the deliverables requested by the user and must be preserved.

04 同仓库更多 Skills

google
google/meridian

Meridian 场景规划数据生成

meridian-scenario-planner

从拟合好的 Meridian 模型生成场景规划器数据,并通过 Colab 交接导出以用于创建 Looker Studio 仪表板。适用于用户想要从已保存的模型生成场景规划数据、预算网格或 Looker Studio 仪表板的场景。不用于可视化模型结果(请使用 meridian-result-visualization)或运行标准预算优化(请使用 meridian-budget-optimization)。

数据分析师数据分析与报告
★ 1.6k
google
google/meridian

Meridian MMM 模型构建

meridian-model-building

指导用户构建 Meridian 营销组合建模(MMM)模型。适用于用户想要加载数据、映射列、配置 ModelSpec、运行探索性数据分析(EDA)、拟合模型并保存模型的场景。不用于结果可视化或创建场景规划器。

数据分析师数据分析与报告
★ 1.6k
google
google/meridian

Meridian 文档咨询

meridian-doc-consultant

通过在 developers.google.com/meridian 上查找并查阅相关文档,帮助用户解答有关 Meridian Marketing Mix Modeling(营销组合建模)和 Meridian GeoX 地理实验的概念、参数和最佳实践问题。当用户询问 Meridian MMM 或 GeoX 主题的解释或指导时使用。不用于直接编写代码或运行模型。

数据分析师网页搜索与信息研究
★ 1.6k
google
google/meridian

Meridian 营销预算优化

meridian-budget-optimization

加载已拟合的 Meridian 模型并运行预算优化场景。适用于用户想要加载已保存的模型,寻找最优预算分配或目标 ROI 支出。不用于模型性能可视化(使用 meridian-result-visualization)或构建/拟合模型(使用 meridian-model-building)。

营销专员数据分析与报告
★ 1.6k