fix: MMM 时间 holdout + 标准化 Ridge/Lasso + Hill 饱和预算优化#1
Merged
Conversation
…et response - H1: add a chronological (time-respecting) train/test split for MMM; report both in-sample and holdout R^2/MAE so the generalization gap is visible. MMM is a daily time series, never random-split. - H2: standardize features + select Ridge/Lasso alpha via TimeSeriesSplit CV over a log grid. Earlier, tiny alphas (1.0/0.1) on unscaled features left Ridge/Lasso coefficients ~identical to OLS (one model dressed as three). - H6: replace the linear budget-response objective with a Hill saturation function (diminishing returns). The old +1.8% gain was a trivial linear- extrapolation artifact; the saturating model honestly shows ~0% reallocation headroom at the current operating point. - Add chronological-split + shrinkage regression tests. - Update README R^2 (in-sample 0.54 / holdout 0.44) and budget table.
test_preprocess.py reads the gitignored mmm_cleaned.parquet, which is absent in CI (the mock-data step only stubs the model JSONs for test_attribution/ test_mmm). These tests now skip when the artifact is missing, matching the pattern in the other repos. Note: this CI step was already failing on main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动
核心问题:MMM 的 R² 是 in-sample 重代入、三模型对比是假的、+1.8% 预算提升是线性外推虚高。
HIGH
StandardScaler+TimeSeriesSplit在 log 网格上选 alpha,三模型显著有别。其他
run_cross_brand_elasticity同步用 chronological split。TestChronologicalSplit、Ridge 收缩回归测试。结果
Checklist
data/processed/models/*.json