[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EKZ50EXV2X8FK0XPJBZFX5":3,"skill-same:01M6EKZ50EXV2X8FK0XPJBZFX5":77},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":57,"repositoryHtmlUrl":58,"repositoryHomepageUrl":6,"ownerHtmlUrl":59,"ownerBlogUrl":60,"ownerDescription":61,"updatedAt":62,"install":63,"resources":76},"01M6EKZ50EXV2X8FK0XPJBZFX5","model-stacking-ensemble",null,"StackingClassifier\u002FStackingRegressor over the tuned base models; meta-learner self-tunes via RidgeCV\u002FLogisticRegressionCV; NEVER compute SHAP for stacking.","cgpan\u002Fedm-ars-public","cgpan","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F118746117?v=4","01M6EKT5TG36Q3GH340QN8RH08","Chenguang Pan","01M6EKT5YTQVRARGJF0VPA1SY7",5,"MIT","https:\u002F\u002Fgithub.com\u002Fcgpan\u002Fedm-ars-public\u002Fblob\u002Fmain\u002Fskills\u002Ftask-type\u002Fmodel-stacking-ensemble\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"model","model stacking ensemble","Meta","shap","stack","never","models","task","base","compute","self","analyst","type","via","learner","2026-11-10 10:12:30",false,"---\nname: model-stacking-ensemble\nlayer: task-type\ndescription: StackingClassifier\u002FStackingRegressor over the tuned base models; meta-learner self-tunes via RidgeCV\u002FLogisticRegressionCV; NEVER compute SHAP for stacking.\ntrigger_keywords:\n  - stacking\n  - stack\n  - ensemble\n  - meta-learner\n  - meta\napplicable_task_types:\n  - prediction\napplicable_datasets: []\napplicable_stages:\n  - Analyst\npriority: 3\nreferences_skills: []\nresources: []\nversion: \"1.0\"\n---\n\n# Stacking Ensemble\n\nBuilt **after** all individual base models are tuned. Stacks the\ntuned base estimators with a self-tuning meta-learner. Reported in\n`model_comparison.csv` so reviewers see whether the stack improved\nover the best individual model — but the stack is **never** used for\nSHAP or any interpretability output.\n\n## Implementation\n\n```python\nfrom sklearn.ensemble import StackingClassifier, StackingRegressor\nfrom sklearn.linear_model import LogisticRegressionCV, RidgeCV\n\nbase_estimators = [\n    (\"lr\", best_lr),\n    (\"rf\", best_rf),\n    (\"xgb\", best_xgb),\n    (\"enet\", best_enet),\n]\nif mlp_enabled:\n    base_estimators.append((\"mlp\", best_mlp))\n\nif is_classification:\n    estimator = StackingClassifier(\n        estimators=base_estimators,\n        final_estimator=LogisticRegressionCV(cv=5, random_state=42),\n        cv=5,\n        passthrough=False,\n        n_jobs=-1,\n    )\nelse:\n    estimator = StackingRegressor(\n        estimators=base_estimators,\n        final_estimator=RidgeCV(),\n        cv=5,\n        passthrough=False,\n        n_jobs=-1,\n    )\n\nestimator.fit(train_X, train_y)\n```\n\n## Hyperparameters\n\n- **No grid.** The meta-learner self-tunes via cross-validation\n  (`LogisticRegressionCV` for classification, `RidgeCV` for\n  regression).\n- `cv=5`, `passthrough=False`. `passthrough=True` would feed the\n  original features into the meta-learner alongside base predictions;\n  the pilot keeps `False` to make the stack interpretable as\n  \"weighted combination of base models.\"\n- `random_state=42` only on the meta-learner where the parameter\n  applies (`LogisticRegressionCV` accepts it; `RidgeCV` does not).\n\n## SHAP — DO NOT compute\n\n`shap_explainer: skip` per the SPEC. Reasons:\n\n1. SHAP for a stacking model requires SHAP for the meta-learner, which\n   only sees the base predictions (not the original features). The\n   resulting SHAP values are for \"contribution of LR's prediction\" \u002F\n   \"contribution of XGB's prediction\", not for original features —\n   not what readers want.\n2. To get SHAP in original-feature space you would need to nest a\n   model-agnostic explainer over the entire stack, which is\n   prohibitively slow and doesn't add interpretive value over the\n   best individual model's SHAP.\n\nThe Critic verifies this: if SHAP outputs were computed for\nStackingClassifier or StackingRegressor, that's a major issue\n(see methodology skill `shap-explainer-selection` for the rule and\nthe Critic checklist item `an_08`).\n\n## Reporting\n\nInclude the stack in `results.all_models` and `model_comparison.csv`.\nDo NOT include it in `top_features`, `feature_importance.csv`, or\nSHAP figures. The \"best individual model\" used for SHAP excludes the\nstack regardless of the stack's relative performance.\n\n## Typical failure modes\n\n- **Stack underperforms the best base model** when the base models\n  are highly correlated (they all make the same errors). Report the\n  result honestly — a stack that ties or loses is informative.\n- **Long fit time** when MLP is in the base set. The 5-fold internal\n  CV during stacking refits each base model 5 more times. Per-step\n  timeout for the stacking fit is 300s; budget accordingly when\n  `mlp_enabled: true`.\n\n## Source provenance\n\nCanonical source: `agent_prompts\u002Fanalyst.yaml` Pilot Model Battery\nrow 6 + `data_registry\u002Ftask_templates\u002Fprediction.yaml` `model_stacking`.\nPer-family extraction (Decision 9). The \"no SHAP for stacking\" rule\nalso lives in `shap-explainer-selection`.\n","# Stacking Ensemble\n\nBuilt **after** all individual base models are tuned. Stacks the\ntuned base estimators with a self-tuning meta-learner. Reported in\n`model_comparison.csv` so reviewers see whether the stack improved\nover the best individual model — but the stack is **never** used for\nSHAP or any interpretability output.\n\n## Implementation\n\n```python\nfrom sklearn.ensemble import StackingClassifier, StackingRegressor\nfrom sklearn.linear_model import LogisticRegressionCV, RidgeCV\n\nbase_estimators = [\n    (\"lr\", best_lr),\n    (\"rf\", best_rf),\n    (\"xgb\", best_xgb),\n    (\"enet\", best_enet),\n]\nif mlp_enabled:\n    base_estimators.append((\"mlp\", best_mlp))\n\nif is_classification:\n    estimator = StackingClassifier(\n        estimators=base_estimators,\n        final_estimator=LogisticRegressionCV(cv=5, random_state=42),\n        cv=5,\n        passthrough=False,\n        n_jobs=-1,\n    )\nelse:\n    estimator = StackingRegressor(\n        estimators=base_estimators,\n        final_estimator=RidgeCV(),\n        cv=5,\n        passthrough=False,\n        n_jobs=-1,\n    )\n\nestimator.fit(train_X, train_y)\n```\n\n## Hyperparameters\n\n- **No grid.** The meta-learner self-tunes via cross-validation\n  (`LogisticRegressionCV` for classification, `RidgeCV` for\n  regression).\n- `cv=5`, `passthrough=False`. `passthrough=True` would feed the\n  original features into the meta-learner alongside base predictions;\n  the pilot keeps `False` to make the stack interpretable as\n  \"weighted combination of base models.\"\n- `random_state=42` only on the meta-learner where the parameter\n  applies (`LogisticRegressionCV` accepts it; `RidgeCV` does not).\n\n## SHAP — DO NOT compute\n\n`shap_explainer: skip` per the SPEC. Reasons:\n\n1. SHAP for a stacking model requires SHAP for the meta-learner, which\n   only sees the base predictions (not the original features). The\n   resulting SHAP values are for \"contribution of LR's prediction\" \u002F\n   \"contribution of XGB's prediction\", not for original features —\n   not what readers want.\n2. To get SHAP in original-feature space you would need to nest a\n   model-agnostic explainer over the entire stack, which is\n   prohibitively slow and doesn't add interpretive value over the\n   best individual model's SHAP.\n\nThe Critic verifies this: if SHAP outputs were computed for\nStackingClassifier or StackingRegressor, that's a major issue\n(see methodology skill `shap-explainer-selection` for the rule and\nthe Critic checklist item `an_08`).\n\n## Reporting\n\nInclude the stack in `results.all_models` and `model_comparison.csv`.\nDo NOT include it in `top_features`, `feature_importance.csv`, or\nSHAP figures. The \"best individual model\" used for SHAP excludes the\nstack regardless of the stack's relative performance.\n\n## Typical failure modes\n\n- **Stack underperforms the best base model** when the base models\n  are highly correlated (they all make the same errors). Report the\n  result honestly — a stack that ties or loses is informative.\n- **Long fit time** when MLP is in the base set. The 5-fold internal\n  CV during stacking refits each base model 5 more times. Per-step\n  timeout for the stacking fit is 300s; budget accordingly when\n  `mlp_enabled: true`.\n\n## Source provenance\n\nCanonical source: `agent_prompts\u002Fanalyst.yaml` Pilot Model Battery\nrow 6 + `data_registry\u002Ftask_templates\u002Fprediction.yaml` `model_stacking`.\nPer-family extraction (Decision 9). The \"no SHAP for stacking\" rule\nalso lives in `shap-explainer-selection`.\n",{"name":5,"layer":39,"version":40,"priority":41,"resources":42,"description":7,"trigger_keywords":43,"applicable_stages":48,"references_skills":50,"applicable_datasets":51,"applicable_task_types":52},"task-type","1.0",3,[],[44,23,45,46,47],"stacking","ensemble","meta-learner","meta",[49],"Analyst",[],[],[53],"prediction","main","1aeaead66d2bf876109f3b101005d2eed54041d9","skills\u002Ftask-type\u002Fmodel-stacking-ensemble",0,"https:\u002F\u002Fgithub.com\u002Fcgpan\u002Fedm-ars-public","https:\u002F\u002Fgithub.com\u002Fcgpan","https:\u002F\u002Fcpan.ai","Ph.D. candidate in Measurement, Evaluation, and Statistics.","2026-09-28 20:39:06",{"source":8,"skillName":5,"commands":64,"prompt":74,"zipAvailable":75},[65,68,71],{"tool":66,"command":67},"npx","npx skills add cgpan\u002Fedm-ars-public --skill model-stacking-ensemble",{"tool":69,"command":70},"bunx","bunx skills add cgpan\u002Fedm-ars-public --skill model-stacking-ensemble",{"tool":72,"command":73},"pnpm","pnpm dlx skills add cgpan\u002Fedm-ars-public --skill model-stacking-ensemble","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcgpan\u002Fedm-ars-public\u002Fblob\u002Fmain\u002Fskills\u002Ftask-type\u002Fmodel-stacking-ensemble\u002FSKILL.md",true,[],[78,91,101,110,123,134],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":34},"01M6EM1ZTQZVAP90DZTVBHCCFB","acm-fixture","Fixture writing skill for ACM acmart sigconf paper output.","https:\u002F\u002Fgithub.com\u002Fcgpan\u002Fedm-ars-public\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fwriting\u002Facm-fixture\u002FSKILL.md",[],[85,86,87,88,89,90],"acm fixture","fixture","writing","LaTeX","writer","paper",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":34},"01M6EM1XNFETAZFGPHQPAXKBYN","prediction-fixture","Fixture skill for the prediction task type; references shap-fixture.","https:\u002F\u002Fgithub.com\u002Fcgpan\u002Fedm-ars-public\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Ftask-type\u002Fprediction-fixture\u002FSKILL.md",[],[86,98,26,31,99,100,22,30],"prediction fixture","references","fixture skill",{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":34},"01M6EM1V4MQXYGQ7K2ZDJRAPSM","causal-fixture","Fixture skill for the causal_inference task type.","https:\u002F\u002Fgithub.com\u002Fcgpan\u002Fedm-ars-public\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Ftask-type\u002Fcausal-fixture\u002FSKILL.md",[],[86,108,31,26,109,100],"causal fixture","inference",{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":34},"01M6EM1SCWFZZ2ACSAP65GNWK9","shap-fixture","Fixture methodology for SHAP feature importance analysis.","https:\u002F\u002Fgithub.com\u002Fcgpan\u002Fedm-ars-public\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fmethodology\u002Fshap-fixture\u002FSKILL.md",[],[117,86,22,118,119,120,121,122],"shap fixture","feature importance","methodology","analysis","explainer","feature",{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":34},"01M6EM1PZC1MK1G0D1YFVYAQ9W","cluster-recon-fixture","Fixture methodology for reconstructing cluster IDs from fingerprint variables.","https:\u002F\u002Fgithub.com\u002Fcgpan\u002Fedm-ars-public\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fmethodology\u002Fcluster-recon-fixture\u002FSKILL.md",[],[130,131,132,86,133,119],"recon","cluster recon fixture","cluster","ids",{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":34},"01M6EM1MZVKMSWEXZ7TJ45DS04","hsls09-fixture","Fixture skill for HSLS:09 with a bundled YAML resource and one cross-reference.","https:\u002F\u002Fgithub.com\u002Fcgpan\u002Fedm-ars-public\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fdataset\u002Fhsls09-fixture\u002FSKILL.md",[],[86,141,142,143,144,100,145,130,132,146],"hsls09 fixture","yaml","public","reference","dataset","registry"]