加入新推出的
Discord 社区,展开实时讨论,获得同行支持,并直接与 Meridian 团队互动!
生成优化结果输出
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
生成优化输出的方法有好几种。您可以:
您还可以绘制优化可视化图表。如需了解详情,请参阅绘制优化可视化图表。
生成 HTML 优化报告
运行以下代码,生成 HTML 优化报告:
如果您使用的是 Colab,并希望将报告导出到 Google 云端硬盘,请在您的 Colab 笔记本上装载 Google 云端硬盘:
from google.colab import drive
drive.mount('/content/drive')
实例化 BudgetOptimizer
类并运行 optimize()
方法。您还可以按照前面部分中所述自定义优化。
budget_optimizer = optimizer.BudgetOptimizer(meridian)
optimization_results = budget_optimizer.optimize()
将文件名和路径传递给 output_model_results_summary
,从而运行优化摘要并将其保存到指定的文件中。
示例:
filepath = '/content/drive/MyDrive'
optimization_results.output_optimization_summary(f'{FILENAME}.html', filepath)
其中:
filepath
是要将该文件保存到的 Google 云端硬盘路径。
FILENAME
是您要为该文件指定的名称,例如 optimization_output.html
。文件扩展名必须为 HTML。
系统会生成 HTML 报告并将其保存到指定的文件位置。
优化方案计划
优化方案计划部分显示了优化后的预算、投资回报率以及增量收入或 KPI。此外,此部分还介绍了渠道层面的支出限制以及预算优化的基准时间段。
输出示例:(点击图片可放大。)

建议的预算分配
建议的预算分配图表显示了各渠道优化后支出的变化情况。此部分还显示了每个渠道从当前支出到优化后支出的增量收入或 KPI 差距。
输出示例:(点击图片可放大。)


按渠道划分的优化后响应曲线
按渠道划分的优化后响应曲线部分会在响应曲线上显示您当前和优化后的渠道级支出水平。
输出示例:(点击图片可放大。)

生成优化结果摘要
您可以生成未优化的数据摘要和优化后的数据摘要,从而自定义自己的报告、可视化图表,或将这些内容导出为其他格式。这些数值摘要更加详细,按渠道对结果进行了细分,便于比较优化后的结果和未优化的结果。
您可以在 optimize()
方法返回的 OptimizationResults
数据类容器中找到这些数据摘要。
未优化的摘要
运行以下命令,生成未优化的数据摘要:
optimization_results.nonoptimized_data
输出示例:
优化后的摘要
运行以下命令,生成优化后的数据摘要:
optimization_results.optimized_data
输出示例:
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-04。
[null,null,["最后更新时间 (UTC):2025-08-04。"],[[["\u003cp\u003eUsers can generate an HTML report of optimization results, customizable by time range, and exportable to Google Drive for sharing.\u003c/p\u003e\n"],["\u003cp\u003eOptimization results can be summarized numerically, providing detailed media metric data for custom reporting, visualizations, or export to other formats.\u003c/p\u003e\n"],["\u003cp\u003eThe optimization HTML report includes sections for the optimization scenario plan, recommended budget allocation, and optimized response curves by channel.\u003c/p\u003e\n"],["\u003cp\u003eBoth non-optimized and optimized data summaries are accessible via the \u003ccode\u003eOptimizationResults\u003c/code\u003e dataclass, offering a detailed breakdown of results by channel.\u003c/p\u003e\n"]]],[],null,["# Generate optimization results output\n\nThere are several options to generate optimizations output. You can:\n\n- [Generate a two-page optimization HTML report](/meridian/docs/user-guide/generate-optimization-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 an optimization results summary](/meridian/docs/user-guide/generate-optimization-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 optimization visualizations. For more information, see [Plot\noptimization\nvisualizations](/meridian/docs/user-guide/plot-optimization-visualizations).\n\nGenerate the optimization HTML report\n-------------------------------------\n\nRun the following code to generate the optimization HTML:\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. Instantiate the `BudgetOptimizer` class and run the `optimize()` method. You\n can also customize the optimization as described in the preceding sections.\n\n budget_optimizer = optimizer.BudgetOptimizer(meridian)\n optimization_results = budget_optimizer.optimize()\n\n3. Pass in the filename and path to `output_model_results_summary` to run the\n summary for optimization and save it to the specified file.\n\n **Example:** \n\n filepath = '/content/drive/MyDrive'\n optimization_results.output_optimization_summary(f'{FILENAME}.html', filepath)\n\n Where:\n - `filepath` is the path in your Google Drive where you want to save your file.\n - `FILENAME` is the name you want to specify for the file, for example `optimization_output.html`. The file extension must be HTML.\n\n The HTML report is generated and saved to the specified file location.\n\n### Optimization scenario plan\n\nThe **Optimization scenario plan** section shows your optimized budget, ROI and\nincremental revenue or KPI. Additionally, this section presents the constraints\nimposed on spending at the channel level and the benchmark time period for\nbudget optimization.\n\n**Example output:** (*Click the image to enlarge.*)\n\n### Recommended budget allocation\n\nThe **Recommended budget allocation** charts show the change\nin optimized spend for each channel. This section also shows the disparity in\nincremental revenue or KPI for each channel from current to optimized spending.\n\n**Example output:** (*Click the image to enlarge.*)\n\n### Optimized response curves by channel\n\nThe **Optimized response curves by channel** section displays your current and\noptimized levels of channel-level spending on the response curves.\n\n**Example output:** (*Click the image to enlarge.*)\n\nGenerate the optimization results summary\n-----------------------------------------\n\nYou can generate non-optimized and optimized data summaries to customize your\nown reports, visualizations, or export them to another format. These numeric\nsummaries go into more detail, breaking down the results by channel so that you\ncan compare the optimized and non-optimized results.\n\nThese data summaries are available inside the `OptimizationResults` dataclass\ncontainer that is returned by `optimize()` method.\n\n### Non-optimized summary\n\nRun the following command to generate the non-optimized data summary: \n\n optimization_results.nonoptimized_data\n\n**Example output:**\n\n### Optimized summary\n\nRun the following command to generate the optimized data summary: \n\n optimization_results.optimized_data\n\n**Example output:**"]]