[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EKYZPARRFQND3PYTTDHWD3":3,"skill-same:01M6EKYZPARRFQND3PYTTDHWD3":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},"01M6EKYZPARRFQND3PYTTDHWD3","model-mlp",null,"MLPClassifier\u002FMLPRegressor with early stopping; tune via 5-fold inner CV; KernelExplainer with bounded sample cap.","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-mlp\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"model","model mlp","network","networks","Fold","Neural","cap","task","analyst","sample","type","cv","via","tune","feedforward","2026-11-10 10:12:30",false,"---\nname: model-mlp\nlayer: task-type\ndescription: MLPClassifier\u002FMLPRegressor with early stopping; tune via 5-fold inner CV; KernelExplainer with bounded sample cap.\ntrigger_keywords:\n  - mlp\n  - neural\n  - network\n  - networks\n  - mlpclassifier\n  - mlpregressor\n  - feedforward\napplicable_task_types:\n  - prediction\napplicable_datasets: []\napplicable_stages:\n  - Analyst\npriority: 3\nreferences_skills: []\nresources: []\nversion: \"1.0\"\n---\n\n# MLP (Multi-Layer Perceptron)\n\nThe non-tree, non-linear model in the battery. Often does not beat\nXGBoost on tabular EDM data, but worth fitting because some outcomes\ndo show non-linear interactions among continuous predictors that the\ngradient-boosted model under-represents.\n\nThis is the only model in the battery that uses `KernelExplainer` for\nSHAP, which carries serious operational risk — see the constraints\nsection below.\n\n## Configuration toggle\n\nThe Analyst checks `## Configuration` in the user message for\n`mlp_enabled`:\n- `mlp_enabled: false` → **skip MLP entirely**. Build StackingEnsemble\n  from the four remaining base models. Total models = 5.\n- `mlp_enabled: true` (or absent) → include MLP. Total models = 6.\n\nWhen MLP is skipped, do NOT add a placeholder MLP entry to\n`results.all_models`; simply omit it.\n\n## Implementation\n\n```python\nfrom sklearn.neural_network import MLPClassifier, MLPRegressor\n\ncls = MLPClassifier if is_classification else MLPRegressor\nestimator = cls(\n    random_state=42,\n    max_iter=500,\n    early_stopping=True,\n    validation_fraction=0.1,\n)\n```\n\n`max_iter=500`, `early_stopping=True`, and `validation_fraction=0.1`\nare **fixed** — not part of the tuning grid. Early stopping uses an\ninternal 10% validation split (taken from the training set, not the\nheld-out test set).\n\n## Hyperparameter grid (5-fold inner CV; group-aware when school IDs are present)\n\n| Parameter | Grid |\n|---|---|\n| `hidden_layer_sizes` | `[(64,), (128,), (64, 32)]` |\n| `learning_rate_init` | `[0.001, 0.01]` |\n| `alpha` (L2) | `[0.0001, 0.001]` |\n\n```python\nfrom sklearn.model_selection import GridSearchCV\n\ngrid_search = GridSearchCV(\n    estimator,\n    param_grid={\n        \"hidden_layer_sizes\": [(64,), (128,), (64, 32)],\n        \"learning_rate_init\": [0.001, 0.01],\n        \"alpha\": [0.0001, 0.001],\n    },\n    cv=cv_splits,\n    scoring=scoring,\n    n_jobs=-1,\n)\ngrid_search.fit(train_X, train_y)\nbest_mlp = grid_search.best_estimator_\n```\n\n## SHAP explainer (CRITICAL constraints)\n\nMLP is the only family in the pilot that uses `shap.KernelExplainer`.\nKernelExplainer is model-agnostic but slow — without bounded sample\ncaps it will silently grow into a multi-hour computation that blows\nthe per-step timeout.\n\nHard constraints (also in the methodology skill `shap-explainer-selection`):\n\n| Constraint | Value |\n|---|---|\n| Sample cap | 1,000 rows max from the test set (sample with `random_state=42` if `n_test > 1000`) |\n| Background data | `shap.kmeans(train_X, 100)` |\n| `nsamples` | 500 |\n| Hard timeout | 600 seconds (signal-based or subprocess-wrapped) |\n\nIf KernelExplainer times out for MLP, the Analyst falls back to the\n**next-best non-MLP individual model** for ALL interpretability outputs\n(beeswarm, bar plot, PDPs, `feature_importance.csv`) and documents the\nfallback in `results.warnings`.\n\n## Typical failure modes\n\n- **Convergence under `max_iter=500`** is common on hard problems.\n  Early stopping mitigates: the trained network is the best\n  validation-loss network seen during training, not necessarily the\n  last iterate.\n- **Feature scaling**: MLP requires features on a common scale.\n  Continuous predictors should be `StandardScaler`-transformed (fit\n  on train only) before MLP fit. Tree models in the battery do not\n  require this; if your pipeline scales for MLP, scale only the MLP's\n  copy of the features.\n- **KernelExplainer timeout**: see above. The fallback rule is\n  authoritative — do NOT silently emit empty interpretability outputs.\n\n## Source provenance\n\nCanonical source: `agent_prompts\u002Fanalyst.yaml` Pilot Model Battery\nrow 5 + §\"KernelExplainer constraints\" + `data_registry\u002Ftask_templates\u002Fprediction.yaml`\n`model_mlp` + `model_mlp.shap_kernel_explainer_constraints`.\n\nPer-family extraction (Decision 9). The KernelExplainer rules also\nappear in `shap-explainer-selection` (cross-cutting methodology); the\ntwo should stay in sync.\n","# MLP (Multi-Layer Perceptron)\n\nThe non-tree, non-linear model in the battery. Often does not beat\nXGBoost on tabular EDM data, but worth fitting because some outcomes\ndo show non-linear interactions among continuous predictors that the\ngradient-boosted model under-represents.\n\nThis is the only model in the battery that uses `KernelExplainer` for\nSHAP, which carries serious operational risk — see the constraints\nsection below.\n\n## Configuration toggle\n\nThe Analyst checks `## Configuration` in the user message for\n`mlp_enabled`:\n- `mlp_enabled: false` → **skip MLP entirely**. Build StackingEnsemble\n  from the four remaining base models. Total models = 5.\n- `mlp_enabled: true` (or absent) → include MLP. Total models = 6.\n\nWhen MLP is skipped, do NOT add a placeholder MLP entry to\n`results.all_models`; simply omit it.\n\n## Implementation\n\n```python\nfrom sklearn.neural_network import MLPClassifier, MLPRegressor\n\ncls = MLPClassifier if is_classification else MLPRegressor\nestimator = cls(\n    random_state=42,\n    max_iter=500,\n    early_stopping=True,\n    validation_fraction=0.1,\n)\n```\n\n`max_iter=500`, `early_stopping=True`, and `validation_fraction=0.1`\nare **fixed** — not part of the tuning grid. Early stopping uses an\ninternal 10% validation split (taken from the training set, not the\nheld-out test set).\n\n## Hyperparameter grid (5-fold inner CV; group-aware when school IDs are present)\n\n| Parameter | Grid |\n|---|---|\n| `hidden_layer_sizes` | `[(64,), (128,), (64, 32)]` |\n| `learning_rate_init` | `[0.001, 0.01]` |\n| `alpha` (L2) | `[0.0001, 0.001]` |\n\n```python\nfrom sklearn.model_selection import GridSearchCV\n\ngrid_search = GridSearchCV(\n    estimator,\n    param_grid={\n        \"hidden_layer_sizes\": [(64,), (128,), (64, 32)],\n        \"learning_rate_init\": [0.001, 0.01],\n        \"alpha\": [0.0001, 0.001],\n    },\n    cv=cv_splits,\n    scoring=scoring,\n    n_jobs=-1,\n)\ngrid_search.fit(train_X, train_y)\nbest_mlp = grid_search.best_estimator_\n```\n\n## SHAP explainer (CRITICAL constraints)\n\nMLP is the only family in the pilot that uses `shap.KernelExplainer`.\nKernelExplainer is model-agnostic but slow — without bounded sample\ncaps it will silently grow into a multi-hour computation that blows\nthe per-step timeout.\n\nHard constraints (also in the methodology skill `shap-explainer-selection`):\n\n| Constraint | Value |\n|---|---|\n| Sample cap | 1,000 rows max from the test set (sample with `random_state=42` if `n_test > 1000`) |\n| Background data | `shap.kmeans(train_X, 100)` |\n| `nsamples` | 500 |\n| Hard timeout | 600 seconds (signal-based or subprocess-wrapped) |\n\nIf KernelExplainer times out for MLP, the Analyst falls back to the\n**next-best non-MLP individual model** for ALL interpretability outputs\n(beeswarm, bar plot, PDPs, `feature_importance.csv`) and documents the\nfallback in `results.warnings`.\n\n## Typical failure modes\n\n- **Convergence under `max_iter=500`** is common on hard problems.\n  Early stopping mitigates: the trained network is the best\n  validation-loss network seen during training, not necessarily the\n  last iterate.\n- **Feature scaling**: MLP requires features on a common scale.\n  Continuous predictors should be `StandardScaler`-transformed (fit\n  on train only) before MLP fit. Tree models in the battery do not\n  require this; if your pipeline scales for MLP, scale only the MLP's\n  copy of the features.\n- **KernelExplainer timeout**: see above. The fallback rule is\n  authoritative — do NOT silently emit empty interpretability outputs.\n\n## Source provenance\n\nCanonical source: `agent_prompts\u002Fanalyst.yaml` Pilot Model Battery\nrow 5 + §\"KernelExplainer constraints\" + `data_registry\u002Ftask_templates\u002Fprediction.yaml`\n`model_mlp` + `model_mlp.shap_kernel_explainer_constraints`.\n\nPer-family extraction (Decision 9). The KernelExplainer rules also\nappear in `shap-explainer-selection` (cross-cutting methodology); the\ntwo should stay in sync.\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,45,21,22,46,47,33],"mlp","neural","mlpclassifier","mlpregressor",[49],"Analyst",[],[],[53],"prediction","main","1aeaead66d2bf876109f3b101005d2eed54041d9","skills\u002Ftask-type\u002Fmodel-mlp",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-mlp",{"tool":69,"command":70},"bunx","bunx skills add cgpan\u002Fedm-ars-public --skill model-mlp",{"tool":72,"command":73},"pnpm","pnpm dlx skills add cgpan\u002Fedm-ars-public --skill model-mlp","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcgpan\u002Fedm-ars-public\u002Fblob\u002Fmain\u002Fskills\u002Ftask-type\u002Fmodel-mlp\u002FSKILL.md",true,[],[78,101,112,121,134,145],{"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":94,"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",[84,89],{"categoryNo":85,"categoryName":86,"taxonomyType":87,"taxonomyTypeDesc":88},"01JBSEEDCAT000000000000018","写作与文案","SCENARIO","使用场景",{"categoryNo":90,"categoryName":91,"taxonomyType":92,"taxonomyTypeDesc":93},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",[95,96,97,98,99,100],"acm fixture","fixture","writing","LaTeX","writer","paper",{"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},"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",[],[96,108,26,29,109,110,111,27],"prediction fixture","references","fixture skill","shap",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"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",[],[96,119,29,26,120,110],"causal fixture","inference",{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"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",[],[128,96,111,129,130,131,132,133],"shap fixture","feature importance","methodology","analysis","explainer","feature",{"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},"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",[],[141,142,143,96,144,130],"recon","cluster recon fixture","cluster","ids",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"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",[],[96,152,153,154,155,110,156,141,143,157],"hsls09 fixture","yaml","public","reference","dataset","registry"]