新しく開設された
Discord コミュニティに参加して、リアルタイムのディスカッション、ユーザー同士のサポート、メリディアン チームとの直接の交流をお楽しみください。
ホールドアウト観測(トレーニングおよびテスト用スプリット)
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
メリディアン モデルの仕様には、ホールドアウト サンプルの指定に使用できる holdout_id
引数(ディメンションのブール値配列 \(G \times T\))が含まれています。ホールドアウト観測の KPI データは、モデルのトレーニング中(例: MCMC による事後分布サンプリング中)は無視され、モデルの尤度や事後密度に影響しません。ホールドアウト観測のメディアデータは、その後の期間の Adstock メディア値に影響するため、モデルのトレーニングに引き続き使われます。
ホールドアウト サンプルは主に、アウトオブサンプル適合度指標(R 2 乗など)の計算に使われます。これは、事前分布の強さなどについて、異なるモデル仕様を比較する場合に便利です(比較する個々のモデルが同じホールドアウト サンプルを使っていることが前提です)。アウトオブサンプル モデルの適合度が最も高いモデルが、因果推論に最適なモデルであるとは限りませんが、通常は適合性の高いモデルが優先されます。モデル仕様が不適切な場合、モデルの適合性低下につながり、因果推論にバイアスを引き起こす可能性もあります。
地域と期間について適正なバランスが取れたホールドアウト サンプルを使うことをおすすめします。つまり、各地域のホールドアウト観測数がほぼ同じで、各期間のホールドアウト観測数もほぼ同じであるホールドアウト サンプルを使用してください。ホールドアウト サンプルのバランスが取れていないと、特定地域の地域効果\(\tau_g\) や特定期間の時間効果 \(\mu_t\) を推定するためのトレーニング観測数が不足する可能性があります。メリディアンは、デフォルトではホールドアウト サンプルを指定しません。ご自身でホールドアウト サンプルを指定し、適度なバランスが取れたサンプルであることを確認する必要があります。
MMM 時間枠の終了時などに KPI の予測誤差を評価する目的で、時間的に連続した大きなデータのチャンクを除外しないようにしてください。メリディアンは KPI を予測するように設計されておらず、特に KPI に強い傾向や季節性がある場合は予測できません。メリディアンは代わりにメディアの因果効果を推定し、ノットベースのアプローチを使って傾向と季節性をモデリングします。ノットベースのアプローチでは、ノットを効果的に推定するために、ノット付近のデータが必要になります。時間的に連続した大きなデータのチャンクが除外されると、除外期間内のノット付近のデータが存在しなくなります。この場合、ノットの事後分布が事前分布によって決定されるため、予測が不正確になる可能性があります。
またメリディアンは、過去と将来の両方のメディア効果の推定に使用できます。これは、時間が推移してもメディア効果を決定するモデル パラメータに一貫性があることがメリディアンの前提であるためです。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-04 UTC。
[null,null,["最終更新日 2025-08-04 UTC。"],[[["\u003cp\u003eThe Meridian model's \u003ccode\u003eholdout_id\u003c/code\u003e argument allows you to specify a holdout sample for calculating out-of-sample goodness of fit metrics, like R-squared, to compare different model specifications.\u003c/p\u003e\n"],["\u003cp\u003eWhile media data for holdout observations is used in training, their KPI data is excluded, ensuring the holdout sample doesn't influence model parameters.\u003c/p\u003e\n"],["\u003cp\u003eFor optimal performance, use a balanced holdout sample across geos and time periods to ensure sufficient data for accurate model estimation.\u003c/p\u003e\n"],["\u003cp\u003eAvoid holding out large, continuous time chunks as Meridian focuses on causal impact estimation, not KPI forecasting, and requires data near knots for effective trend and seasonality modeling.\u003c/p\u003e\n"],["\u003cp\u003eMeridian can be used to estimate the impact of both past and future media due to its assumption of consistent media impact parameters over time.\u003c/p\u003e\n"]]],["The `holdout_id` in the Meridian model defines a holdout sample, where KPI data is excluded from model training but media data is still used. This holdout is used to calculate out-of-sample fit metrics. It is recommended the holdout sample be balanced across geos and time periods. Avoid holding out large contiguous time blocks as this can negatively impact the estimation of knots, affecting model forecasting ability. Meridian can estimate the impact of both past and future media.\n"],null,["# Holdout observations (train and test split)\n\nThe Meridian model specification contains a `holdout_id` argument (a\nboolean array of dimensions \\\\(G \\\\times T\\\\)) that can be used to specify a\nholdout sample. The KPI data of the holdout observations is ignored during model\ntraining (for example, MCMC posterior sampling), and does not affect the model\nlikelihood or posterior density. Media data for the holdout observations is\nstill used for model training, because it affects the adstocked media values for\nsubsequent time periods.\n\nThe primary use of the holdout sample is for calculating out-of-sample goodness\nof fit metrics, such as R-squared. This is useful for comparing different model\nspecifications, such as prior distribution strengths, provided that each model\nbeing compared uses the same holdout sample. There is no guarantee that the\nmodel with the best out-of-sample model fit is the best model for causal\ninference, but generally a better fitting model is preferred. Model\nmisspecifications that lead to poor model fit can also cause bias in causal\ninference.\n\nWe recommend using a holdout sample that is fairly balanced across geos and time\nperiods. In other words, use a holdout sample that has approximately the same\nnumber of holdout observations for each geo and approximately the same number of\nholdout observations for each time period. If the holdout sample is imbalanced,\nthis can result in too few training observations to estimate the geo effect\n\\\\(\\\\tau_g\\\\) for certain geos, or the time effect \\\\(\\\\mu_t\\\\) for certain time\nperiods. By default, Meridian does not specify a holdout sample. You\nmust specify the holdout sample and ensure that it has a reasonable degree of\nbalance.\n\nAvoid holding out large, contiguous-in-time, chunks of data, such as at the end\nof the MMM time window, to assess forecast error in the KPI. Meridian\nisn't designed for forecasting the KPI, especially if there is strong trend and\nseasonality in the KPI. Instead, Meridian estimates the causal media\nimpact and uses the knot-based approach to modeling trend and seasonality. The\nknot-based approach needs data near the knot to estimate the knot effectively.\nIf large, contiguous-in-time, chunks of data are held out, there is no data near\nthe knots within the held out period. In this case, the knot's posterior\ndistribution is driven by the prior, which can result in poor forecasting.\n\nAdditionally, Meridian can be used to estimate the impact of both\nhistorical and future media because it assumes that model parameters which\ndetermine media impact are consistent over time."]]