加入新推出的
Discord 社区,展开实时讨论,获得同行支持,并直接与 Meridian 团队互动!
生成模型结果输出
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
可通过多种方法来生成模型结果输出。您可以:
您还可以绘制媒体可视化图表。如需了解详情,请参阅绘制媒体可视化图表。
生成 HTML 模型结果报告
如需生成并导出模型结果报告,请执行以下操作:
如果您使用的是 Colab,并希望将报告导出到 Google 云端硬盘,请在您的 Colab 笔记本上装载 Google 云端硬盘:
from google.colab import drive
drive.mount('/content/drive')
使用 Meridian 模型对象初始化 Summarizer
类:
summarizer = summarizer.Summarizer(meridian)
将文件名、路径、开始日期和结束日期传递给 output_model_results_summary
,以针对相应时间段生成摘要并将其保存到指定的文件中。
示例:
filepath = '/content/drive/MyDrive'
start_date = '2020-01-05'
end_date = '2020-12-27'
summarizer.output_model_results_summary(f'{FILENAME}.html',
filepath,
start_date,
end_date)
其中:
filepath
是要将该文件保存到的 Google 云端硬盘路径。
start_date
是报告的开始日期,格式为 yyyy-mm-dd。
end_date
是报告的结束日期,格式为 yyyy-mm-dd。
FILENAME
是您要为该文件指定的名称,例如 summary_output.html
。文件扩展名必须为 HTML。
系统会生成 HTML 报告并将其保存到指定的文件位置。
模型拟合度
在模型拟合度部分,您可以检查统计拟合优度。Meridian 会报告模型拟合统计信息,包括 R 平方、平均绝对百分比误差 (MAPE) 和加权平均绝对百分比误差 (wMAPE)。此外,Meridian 还提供将预测收入(或 KPI)与实际收入(或 KPI)数据进行对比的直观表示形式。借助这类图,您可以评估模型的表现,以及确定模型是否欠拟合。
模型拟合统计信息还可用于比较候选模型。不过请注意,拟合优度指标并不能全面反映模型在因果推理方面的效果,用于因果推理的最佳模型可能与用于预测的最佳模型有所不同。
如需了解如何评估模型拟合度,请参阅建模诊断。
输出示例:(点击图片可放大。)

收入或 KPI 贡献
收入或 KPI 贡献部分分析了媒体和非媒体活动对收入或 KPI 表现的影响。在这一部分,您可以比较不同渠道的关键指标,例如投资回报率 (ROI)、支出百分比以及增量收入或增量 KPI 的百分比。此外,您还可以在该部分按基准、降价促销和各种营销渠道细分贡献。
输出示例:(点击图片可放大。)

投资回报率
在投资回报率部分,您可以更深入地了解各个渠道的投资回报率分析,以便找出效果最佳的渠道。您可以比较各个渠道的投资回报率、边际投资回报率和效果。此外,这一部分还提供投资回报率估计的置信区间,这是贝叶斯模型的一大优势。
输出示例:(点击图片可放大。)

最佳分析
最佳分析部分显示了您当前的支出水平,以及每个渠道的支出金额带来的边际回报何时开始递减;还提供了最佳频次建议,以帮助您决定下一年的预算分配重点。
输出示例:
生成模型结果摘要
模型结果摘要通过 MediaSummary
类生成。启动此类时,可以使用 confidence_level
实参指定模型结果的可信区间,并使用 selected_times
实参指定模型估计的时间段。默认使用 90% 可信区间和完整建模窗口生成摘要统计信息。
示例:
运行以下命令可使用默认设置生成摘要:
media_summary = visualizer.MediaSummary(meridian)
media_summary.summary_table()
输出示例:(点击图片可放大。)

如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-04。
[null,null,["最后更新时间 (UTC):2025-08-04。"],[[["\u003cp\u003eYou can generate a two-page HTML report with a custom time range and export it to Google Drive for team sharing.\u003c/p\u003e\n"],["\u003cp\u003eA model results summary can be generated, allowing for the customization of reports and visualizations or exportation to other formats for more detailed numerical analysis of media metrics.\u003c/p\u003e\n"],["\u003cp\u003eThe model's fit section offers a statistical goodness of fit check, including R-squared, MAPE, and wMAPE, and visual comparisons of predicted vs.actual revenue/KPI figures.\u003c/p\u003e\n"],["\u003cp\u003eThe Revenue or KPI Contribution section analyzes the impact of media and non-media activities, allowing for comparison of ROI, spend percentage, and incremental revenue across channels.\u003c/p\u003e\n"],["\u003cp\u003eThe Optimal Analysis section indicates current spend levels and diminishing returns, offering optimal frequency recommendations for budget allocation in the next year.\u003c/p\u003e\n"]]],["Model results can be outputted as an HTML report or a numerical summary. To generate an HTML report, initialize the `Summarizer` class, and use `output_model_results_summary`, specifying the filename, path, and desired time range. The report includes model fit statistics, revenue/KPI contribution, ROI analysis, and optimal analysis sections. To generate a numerical summary, use the `MediaSummary` class and its `summary_table` function. Both allow customization of the output time range.\n"],null,["# Generate model results output\n\nThere are several options to generate model results output. You can:\n\n- [Generate a two-page HTML report](/meridian/docs/user-guide/generate-model-results-output#html)\n with a custom time range and export the HTML output to your Google Drive to\n share with your team.\n\n- [Generate a model results summary](/meridian/docs/user-guide/generate-model-results-output#summary)\n to customize your own reports, visualizations, or export them to another\n format. These numerical summaries of your media metrics let you access more\n detail.\n\nYou can also plot media visualizations. For more information, see [Plot media\nvisualizations](/meridian/docs/user-guide/plot-media-visualizations).\n\nGenerate the model results HTML report\n--------------------------------------\n\nTo generate and export the model results report:\n\n1. If you use Colab and want to export the report to your Google Drive, mount\n Google Drive to your Colab notebook:\n\n from google.colab import drive\n drive.mount('/content/drive')\n\n2. Initialize the `Summarizer` class with the Meridian model object:\n\n summarizer = summarizer.Summarizer(meridian)\n\n3. Pass in the filename, path, start date, and end date to\n `output_model_results_summary` to run the summary for that time duration and\n save it to the specified file.\n\n **Example:** \n\n filepath = '/content/drive/MyDrive'\n start_date = '2020-01-05'\n end_date = '2020-12-27'\n summarizer.output_model_results_summary(f'{FILENAME}.html',\n filepath,\n start_date,\n end_date)\n\n Where:\n - `filepath` is the path in your Google Drive where you want to save your file.\n - `start_date` is the report's start date using the yyyy-mm-dd format.\n - `end_date` is the report's end date using the yyyy-mm-dd format.\n - `FILENAME` is the name you want to specify for the file, for example `summary_output.html`. The file extension must be HTML.\n\n The HTML report is generated and saved to the specified file location.\n\n### Your model's fit\n\nThe **Your model's fit** section lets you check statistical goodness of fit.\nMeridian reports model fit statistics including R-squared, Mean Absolute\nPercentage Error (MAPE) and Weighted Mean Absolute Percentage Error (wMAPE).\nAdditionally, Meridian provides visual representations comparing\npredicted revenue (or KPI) to actual revenue (or KPI) figures. These plots\nfacilitate the assessment of the model's performance and assist in determining\nwhether the model is underfitted.\n\nModel fit statistics can also be useful for comparing candidate models. However,\nkeep in mind that goodness of fit metrics don't give a complete picture of how\ngood a model is for causal inference, and it might likely be the case that the\nbest model for causal inference is different from the best model for prediction.\n\nFor information about assessing the model fit, see [Modeling\ndiagnostics](/meridian/docs/user-guide/model-diagnostics).\n\n**Example output:** (*Click the image to enlarge.*)\n\n### Revenue or KPI contribution\n\nThe **Revenue or KPI Contribution** section provides an analysis of the impact\nof your media and non-media activities on your revenue or KPI performance. It\nlets you compare key metrics such as return on investment (ROI), percent of\nspend, and percent of incremental revenue or KPI across different channels.\nAdditionally, this section lets you break down the contribution by baseline,\npricing promotions, and various marketing channels.\n\n**Example output:** (*Click the image to enlarge.*)\n\n### Return on investment\n\nThe **Return on investment** section provides a deeper view of ROI analysis for\nchannels to help you identify the highest performing channels. You can compare\nROI, marginal ROI, and effectiveness across channels. Additionally, this section\npresents the credible interval for the ROI estimations, which constitutes one\nadvantage of Bayesian models.\n\n**Example output:** (*Click the image to enlarge.*)\n\n### Optimal Analysis\n\nThe **Optimal Analysis** section shows your current spend level and where you\nstart to see diminishing marginal returns on the amount of money you are\nspending per channel, and provides optimal frequency recommendations to help you\ndecide how to focus your budget for the next year.\n\n**Example output:**\n\nGenerate the model results summary\n----------------------------------\n\nThe model results summaries are generated through the `MediaSummary` class. When\ninitiating this class, the credible interval for the model results can be\nspecified using the `confidence_level` argument, while the time period for the\nmodel estimation can be specified using the `selected_times` argument. By\ndefault, the summary statistics are generated using a 90% credible interval and\nthe full modeling window.\n\n**Example:**\n\nRun the following commands to generate the summary using the default settings: \n\n media_summary = visualizer.MediaSummary(meridian)\n media_summary.summary_table()\n\n**Example output:** (*Click the image to enlarge.*)"]]