[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EKWBSCAJSSX8QH8D39APYA":3,"skill-same:01M6EKWBSCAJSSX8QH8D39APYA":79},{"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":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":6,"ownerHtmlUrl":61,"ownerBlogUrl":62,"ownerDescription":63,"updatedAt":64,"install":65,"resources":78},"01M6EKWBSCAJSSX8QH8D39APYA","causal-itr-policy-learning",null,"M6 — doubly-robust policy learning; DR pseudo-outcomes + shallow sklearn policy tree restricted to rule_covariates; no econml dependency.","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\u002Fmethodology\u002Fcausal-itr-policy-learning\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31],"policy","learning","causal itr policy learning","diagnostics","Evaluation","data","methodology","outcomes","dependency","engineer","analyst","contract","rule","2026-11-10 10:12:30",false,"---\nname: causal-itr-policy-learning\nlayer: methodology\ndescription: M6 — doubly-robust policy learning; DR pseudo-outcomes + shallow sklearn policy tree restricted to rule_covariates; no econml dependency.\ntrigger_keywords:\n  - policy\n  - rule\n  - targeting\n  - regime\n  - itr\n  - treatment-rule\napplicable_task_types:\n  - causal_itr\napplicable_datasets: []\napplicable_stages:\n  - Analyst\npriority: 1\nreferences_skills:\n  - causal-itr-policy-value-evaluation\n  - causal-forest-cate\n  - causal-positivity-diagnostics\n  - causal-data-engineer-contract\nresources: []\nversion: \"1.1\"\nrule_severity: mandatory\n---\n\n# Causal ITR Policy Learning (M6)\n\nLearn an interpretable treatment rule π(x) ∈ {0, 1} that maximizes the\ndoubly-robust estimate of the population outcome, conditioning ONLY on\n`research_spec.rule_covariates`.\n\n## The recipe (sklearn only — econml is NOT installed in the sandbox)\n\n1. **Cross-fitted nuisance models** (K = 5, `GroupKFold` on the\n   school cluster IDs per D1; `random_state=42` everywhere):\n   - Outcome models `μ̂₁(x)`, `μ̂₀(x)`: `GradientBoostingClassifier`\n     (binary Y, use `predict_proba`) or `GradientBoostingRegressor`\n     (continuous Y), fit separately on treated \u002F control rows of the\n     TRAINING folds, predicted on the held-out fold.\n   - Propensity `ê(x)`: `LogisticRegression(max_iter=1000)` on the full\n     adjustment set; clip to `[0.02, 0.98]`.\n2. **DR pseudo-outcome (per unit, out-of-fold):**\n\n   ```\n   Γ_i = μ̂₁(x_i) − μ̂₀(x_i)\n         + T_i · (Y_i − μ̂₁(x_i)) \u002F ê(x_i)\n         − (1 − T_i) · (Y_i − μ̂₀(x_i)) \u002F (1 − ê(x_i))\n   ```\n\n3. **Policy tree via weighted classification**: fit\n   `DecisionTreeClassifier(max_depth=2, min_samples_leaf=200,\n   random_state=42)` on features = rule_covariates ONLY, labels =\n   `(Γ_i > 0)`, `sample_weight = |Γ_i|`. This is the standard\n   weighted-classification reduction of policy learning.\n4. **Rule extraction**: walk the fitted tree and emit\n   `policy_rule_text` as a human-readable conjunction per leaf (e.g.\n   \"treat if X1SES \u003C -0.12 and X1TXMTSCOR \u003C 51.3\"). Depth > 3 is a\n   contract violation — interpretability is the point.\n5. Report `n_treated_by_rule` \u002F `share_treated_by_rule` on the analytic\n   sample. A rule that treats \u003C 2% or > 98% of students is effectively\n   constant — flag in warnings and let M7's best-constant comparison\n   carry the story.\n\n## Deterministic implementation (MANDATORY - R3-followup)\n\nDo NOT re-implement the recipe: call the shipped helpers\n(`import analysis_helpers`):\n\n```python\ngamma = analysis_helpers.itr_dr_pseudo_outcomes(df, T, Y, adjustment_cols, groups=school_ids)\ntree, rule_text, share = analysis_helpers.itr_learn_policy_tree(df, gamma, rule_covariate_cols)\n```\n\n`itr_learn_policy_tree` raises ValueError on a degenerate rule (share\noutside [0.02, 0.98]) - catch it and report \"no meaningful targeting\nrule\" honestly (F-R3-M6-SCALE-DEGENERATE-RULE was a live\ntreat-everyone rule with thresholds outside the covariate ranges from\na hand-rolled re-implementation).\n\n## Hard constraints\n\n- Rule features = `rule_covariates` (resolved via D1's\n  `resolve_encoded_columns`) and NOTHING else. Using the full\n  adjustment set in the tree is a violation: rule covariates are the\n  variables a school could actually observe and act on at decision\n  time.\n- The tree is fit on out-of-fold Γ̂ — never refit nuisances in-sample.\n- Positivity first: apply G3's trimming\u002Foverlap handling BEFORE\n  computing Γ (clipped ê is a floor, not a substitute for the G3\n  diagnostics).\n\n## Output schema\n\n`estimates.M6` per the causal_itr Analyst prompt: `policy_rule_text`,\n`tree_depth`, `rule_covariates_used`, `n_treated_by_rule`,\n`share_treated_by_rule`, `notes`.\n\n## Failures prevented\n\nRule-covariate leakage (conditioning on unactionable covariates);\nin-sample policy evaluation; black-box uninterpretable regimes;\ndegenerate near-constant rules reported as \"targeting\".\n\n## Source provenance\n\nAuthored in V3.1 Arc R (R1) per the causal-ITR scope note (internal). The\nweighted-classification reduction follows the standard\npolicy-learning literature (offline evaluation via DR scoring); the\nsklearn-only constraint comes from `requirements-sandbox.txt`.\n","# Causal ITR Policy Learning (M6)\n\nLearn an interpretable treatment rule π(x) ∈ {0, 1} that maximizes the\ndoubly-robust estimate of the population outcome, conditioning ONLY on\n`research_spec.rule_covariates`.\n\n## The recipe (sklearn only — econml is NOT installed in the sandbox)\n\n1. **Cross-fitted nuisance models** (K = 5, `GroupKFold` on the\n   school cluster IDs per D1; `random_state=42` everywhere):\n   - Outcome models `μ̂₁(x)`, `μ̂₀(x)`: `GradientBoostingClassifier`\n     (binary Y, use `predict_proba`) or `GradientBoostingRegressor`\n     (continuous Y), fit separately on treated \u002F control rows of the\n     TRAINING folds, predicted on the held-out fold.\n   - Propensity `ê(x)`: `LogisticRegression(max_iter=1000)` on the full\n     adjustment set; clip to `[0.02, 0.98]`.\n2. **DR pseudo-outcome (per unit, out-of-fold):**\n\n   ```\n   Γ_i = μ̂₁(x_i) − μ̂₀(x_i)\n         + T_i · (Y_i − μ̂₁(x_i)) \u002F ê(x_i)\n         − (1 − T_i) · (Y_i − μ̂₀(x_i)) \u002F (1 − ê(x_i))\n   ```\n\n3. **Policy tree via weighted classification**: fit\n   `DecisionTreeClassifier(max_depth=2, min_samples_leaf=200,\n   random_state=42)` on features = rule_covariates ONLY, labels =\n   `(Γ_i > 0)`, `sample_weight = |Γ_i|`. This is the standard\n   weighted-classification reduction of policy learning.\n4. **Rule extraction**: walk the fitted tree and emit\n   `policy_rule_text` as a human-readable conjunction per leaf (e.g.\n   \"treat if X1SES \u003C -0.12 and X1TXMTSCOR \u003C 51.3\"). Depth > 3 is a\n   contract violation — interpretability is the point.\n5. Report `n_treated_by_rule` \u002F `share_treated_by_rule` on the analytic\n   sample. A rule that treats \u003C 2% or > 98% of students is effectively\n   constant — flag in warnings and let M7's best-constant comparison\n   carry the story.\n\n## Deterministic implementation (MANDATORY - R3-followup)\n\nDo NOT re-implement the recipe: call the shipped helpers\n(`import analysis_helpers`):\n\n```python\ngamma = analysis_helpers.itr_dr_pseudo_outcomes(df, T, Y, adjustment_cols, groups=school_ids)\ntree, rule_text, share = analysis_helpers.itr_learn_policy_tree(df, gamma, rule_covariate_cols)\n```\n\n`itr_learn_policy_tree` raises ValueError on a degenerate rule (share\noutside [0.02, 0.98]) - catch it and report \"no meaningful targeting\nrule\" honestly (F-R3-M6-SCALE-DEGENERATE-RULE was a live\ntreat-everyone rule with thresholds outside the covariate ranges from\na hand-rolled re-implementation).\n\n## Hard constraints\n\n- Rule features = `rule_covariates` (resolved via D1's\n  `resolve_encoded_columns`) and NOTHING else. Using the full\n  adjustment set in the tree is a violation: rule covariates are the\n  variables a school could actually observe and act on at decision\n  time.\n- The tree is fit on out-of-fold Γ̂ — never refit nuisances in-sample.\n- Positivity first: apply G3's trimming\u002Foverlap handling BEFORE\n  computing Γ (clipped ê is a floor, not a substitute for the G3\n  diagnostics).\n\n## Output schema\n\n`estimates.M6` per the causal_itr Analyst prompt: `policy_rule_text`,\n`tree_depth`, `rule_covariates_used`, `n_treated_by_rule`,\n`share_treated_by_rule`, `notes`.\n\n## Failures prevented\n\nRule-covariate leakage (conditioning on unactionable covariates);\nin-sample policy evaluation; black-box uninterpretable regimes;\ndegenerate near-constant rules reported as \"targeting\".\n\n## Source provenance\n\nAuthored in V3.1 Arc R (R1) per the causal-ITR scope note (internal). The\nweighted-classification reduction follows the standard\npolicy-learning literature (offline evaluation via DR scoring); the\nsklearn-only constraint comes from `requirements-sandbox.txt`.\n",{"name":5,"layer":25,"version":37,"priority":38,"resources":39,"description":7,"rule_severity":40,"trigger_keywords":41,"applicable_stages":46,"references_skills":48,"applicable_datasets":53,"applicable_task_types":54},"1.1",1,[],"mandatory",[19,31,42,43,44,45],"targeting","regime","itr","treatment-rule",[47],"Analyst",[49,50,51,52],"causal-itr-policy-value-evaluation","causal-forest-cate","causal-positivity-diagnostics","causal-data-engineer-contract",[],[55],"causal_itr","main","1aeaead66d2bf876109f3b101005d2eed54041d9","skills\u002Fmethodology\u002Fcausal-itr-policy-learning",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":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add cgpan\u002Fedm-ars-public --skill causal-itr-policy-learning",{"tool":71,"command":72},"bunx","bunx skills add cgpan\u002Fedm-ars-public --skill causal-itr-policy-learning",{"tool":74,"command":75},"pnpm","pnpm dlx skills add cgpan\u002Fedm-ars-public --skill causal-itr-policy-learning","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcgpan\u002Fedm-ars-public\u002Fblob\u002Fmain\u002Fskills\u002Fmethodology\u002Fcausal-itr-policy-learning\u002FSKILL.md",true,[],[80,93,106,115,127,138],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":32},"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",[],[87,88,89,90,91,92],"acm fixture","fixture","writing","LaTeX","writer","paper",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":32},"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",[],[88,100,101,102,103,104,105,29],"prediction fixture","task","type","references","fixture skill","shap",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":32},"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",[],[88,113,102,101,114,104],"causal fixture","inference",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":32},"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",[],[122,88,105,123,25,124,125,126],"shap fixture","feature importance","analysis","explainer","feature",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":32},"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",[],[134,135,136,88,137,25],"recon","cluster recon fixture","cluster","ids",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":32},"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",[],[88,145,146,147,148,104,149,134,136,150],"hsls09 fixture","yaml","public","reference","dataset","registry"]