[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EKZ2EW3GG3YG8AZ5FXPPWW":3,"skill-same:01M6EKZ2EW3GG3YG8AZ5FXPPWW":83},{"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":54,"commitSha":55,"skillDirectory":56,"forksCount":57,"repositoryHtmlUrl":58,"repositoryHomepageUrl":6,"ownerHtmlUrl":59,"ownerBlogUrl":60,"ownerDescription":61,"updatedAt":62,"install":63,"resources":76},"01M6EKZ2EW3GG3YG8AZ5FXPPWW","model-random-forest",null,"Random Forest classifier\u002Fregressor; tune via 5-fold inner CV; TreeExplainer for SHAP.","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-random-forest\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31],"model","random forest","model random forest","shap","Fold","classifier","task","analyst","type","cv","via","tune","trees","2026-11-10 10:12:30",false,"---\nname: model-random-forest\nlayer: task-type\ndescription: Random Forest classifier\u002Fregressor; tune via 5-fold inner CV; TreeExplainer for SHAP.\ntrigger_keywords:\n  - random\n  - forest\n  - randomforest\n  - rf\n  - tree\n  - trees\n  - ensemble\napplicable_task_types:\n  - prediction\napplicable_datasets: []\napplicable_stages:\n  - Analyst\npriority: 2\nreferences_skills: []\nresources: []\nversion: \"1.0\"\n---\n\n# Random Forest\n\nA tree-bagging ensemble. Robust to outliers and unscaled features,\nhandles mixed-type inputs cleanly, and (with `TreeExplainer`) produces\nfast, exact SHAP values. Strong baseline ensemble — the result the\ngradient-boosted model has to beat.\n\n## Implementation\n\n```python\nfrom sklearn.ensemble import RandomForestClassifier, RandomForestRegressor\n\ncls = RandomForestClassifier if is_classification else RandomForestRegressor\nestimator = cls(random_state=42)\n```\n\n## Hyperparameter grid (5-fold inner CV; group-aware when school IDs are present)\n\n| Parameter | Grid |\n|---|---|\n| `n_estimators` | `[100, 300, 500]` |\n| `max_depth` | `[5, 10, None]` |\n| `min_samples_leaf` | `[1, 5, 10]` |\n\nTuning protocol: see the `inner-cv-tuning-discipline` methodology skill.\nUse `GridSearchCV` with `scoring='roc_auc'` (classification) or\n`'neg_root_mean_squared_error'` (regression).\n\n```python\nfrom sklearn.model_selection import GridSearchCV\n\ngrid_search = GridSearchCV(\n    estimator,\n    param_grid={\n        \"n_estimators\": [100, 300, 500],\n        \"max_depth\": [5, 10, None],\n        \"min_samples_leaf\": [1, 5, 10],\n    },\n    cv=cv_splits,            # group-aware folds when train_school_ids exists\n    scoring=scoring,\n    n_jobs=-1,\n)\ngrid_search.fit(train_X, train_y)\nbest_rf = grid_search.best_estimator_\n```\n\n`random_state=42` for the underlying estimator. `n_jobs=-1` is fine for\nboth fitting and grid search; the per-step timeout is 300s.\n\n## SHAP explainer\n\n`shap.TreeExplainer` — exact and fast for forests; no sample cap\nneeded for typical HSLS-scale test sets.\n\n## Typical failure modes\n\n- **`max_depth=None` + huge `n_estimators` on small training sets**\n  overfits aggressively. The grid above caps depth at `None` only\n  alongside `min_samples_leaf >= 5` to limit single-leaf decisions.\n- **TreeExplainer + categorical encoding mismatch** can produce SHAP\n  values that don't match the model's predictions. Always pass the\n  same column order\u002Fencoding used at fit time.\n\n## Source provenance\n\nCanonical source: `agent_prompts\u002Fanalyst.yaml` Pilot Model Battery\nrow 2 + `data_registry\u002Ftask_templates\u002Fprediction.yaml` `model_rf`.\nPer-family extraction (Decision 9).\n","# Random Forest\n\nA tree-bagging ensemble. Robust to outliers and unscaled features,\nhandles mixed-type inputs cleanly, and (with `TreeExplainer`) produces\nfast, exact SHAP values. Strong baseline ensemble — the result the\ngradient-boosted model has to beat.\n\n## Implementation\n\n```python\nfrom sklearn.ensemble import RandomForestClassifier, RandomForestRegressor\n\ncls = RandomForestClassifier if is_classification else RandomForestRegressor\nestimator = cls(random_state=42)\n```\n\n## Hyperparameter grid (5-fold inner CV; group-aware when school IDs are present)\n\n| Parameter | Grid |\n|---|---|\n| `n_estimators` | `[100, 300, 500]` |\n| `max_depth` | `[5, 10, None]` |\n| `min_samples_leaf` | `[1, 5, 10]` |\n\nTuning protocol: see the `inner-cv-tuning-discipline` methodology skill.\nUse `GridSearchCV` with `scoring='roc_auc'` (classification) or\n`'neg_root_mean_squared_error'` (regression).\n\n```python\nfrom sklearn.model_selection import GridSearchCV\n\ngrid_search = GridSearchCV(\n    estimator,\n    param_grid={\n        \"n_estimators\": [100, 300, 500],\n        \"max_depth\": [5, 10, None],\n        \"min_samples_leaf\": [1, 5, 10],\n    },\n    cv=cv_splits,            # group-aware folds when train_school_ids exists\n    scoring=scoring,\n    n_jobs=-1,\n)\ngrid_search.fit(train_X, train_y)\nbest_rf = grid_search.best_estimator_\n```\n\n`random_state=42` for the underlying estimator. `n_jobs=-1` is fine for\nboth fitting and grid search; the per-step timeout is 300s.\n\n## SHAP explainer\n\n`shap.TreeExplainer` — exact and fast for forests; no sample cap\nneeded for typical HSLS-scale test sets.\n\n## Typical failure modes\n\n- **`max_depth=None` + huge `n_estimators` on small training sets**\n  overfits aggressively. The grid above caps depth at `None` only\n  alongside `min_samples_leaf >= 5` to limit single-leaf decisions.\n- **TreeExplainer + categorical encoding mismatch** can produce SHAP\n  values that don't match the model's predictions. Always pass the\n  same column order\u002Fencoding used at fit time.\n\n## Source provenance\n\nCanonical source: `agent_prompts\u002Fanalyst.yaml` Pilot Model Battery\nrow 2 + `data_registry\u002Ftask_templates\u002Fprediction.yaml` `model_rf`.\nPer-family extraction (Decision 9).\n",{"name":5,"layer":37,"version":38,"priority":39,"resources":40,"description":7,"trigger_keywords":41,"applicable_stages":48,"references_skills":50,"applicable_datasets":51,"applicable_task_types":52},"task-type","1.0",2,[],[42,43,44,45,46,31,47],"random","forest","randomforest","rf","tree","ensemble",[49],"Analyst",[],[],[53],"prediction","main","1aeaead66d2bf876109f3b101005d2eed54041d9","skills\u002Ftask-type\u002Fmodel-random-forest",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-random-forest",{"tool":69,"command":70},"bunx","bunx skills add cgpan\u002Fedm-ars-public --skill model-random-forest",{"tool":72,"command":73},"pnpm","pnpm dlx skills add cgpan\u002Fedm-ars-public --skill model-random-forest","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcgpan\u002Fedm-ars-public\u002Fblob\u002Fmain\u002Fskills\u002Ftask-type\u002Fmodel-random-forest\u002FSKILL.md",true,[77],{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"README.md","REFERENCE","参考文档",1233,"https:\u002F\u002Fgithub.com\u002Fangel5002\u002Fkfc-arquitectura-empresarial\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ffrontend-design\u002FREADME.md",[84,97,107,116,129,140],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"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",[],[91,92,93,94,95,96],"acm fixture","fixture","writing","LaTeX","writer","paper",{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"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",[],[92,104,25,27,105,106,22,26],"prediction fixture","references","fixture skill",{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"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",[],[92,114,27,25,115,106],"causal fixture","inference",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"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",[],[123,92,22,124,125,126,127,128],"shap fixture","feature importance","methodology","analysis","explainer","feature",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"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",[],[136,137,138,92,139,125],"recon","cluster recon fixture","cluster","ids",{"skillNo":141,"name":142,"nameZh":6,"description":143,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":144,"categories":145,"keywords":146,"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",[],[92,147,148,149,150,106,151,136,138,152],"hsls09 fixture","yaml","public","reference","dataset","registry"]