@brainpilot/skills 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/dist/index.d.ts +6 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +28 -0
  4. package/dist/index.js.map +1 -0
  5. package/package.json +35 -0
  6. package/skills/01_Meta-Skills/contribute-skill/SKILL.md +277 -0
  7. package/skills/01_Meta-Skills/contribute-skills-via-pr/SKILL.md +163 -0
  8. package/skills/01_Meta-Skills/paper-to-skill/SKILL.md +435 -0
  9. package/skills/01_Meta-Skills/paper-to-skill/references/extraction-guide.md +286 -0
  10. package/skills/01_Meta-Skills/paper-to-skill/references/skill-template.md +250 -0
  11. package/skills/01_Meta-Skills/repo-to-skill/SKILL.md +289 -0
  12. package/skills/01_Meta-Skills/share-case/SKILL.md +253 -0
  13. package/skills/01_Meta-Skills/share-usage/README.md +63 -0
  14. package/skills/01_Meta-Skills/share-usage/SKILL.md +395 -0
  15. package/skills/01_Meta-Skills/verify-skill/SKILL.md +331 -0
  16. package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/SKILL.md +194 -0
  17. package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/references/effect-sizes.md +352 -0
  18. package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/references/sample-size-guide.md +407 -0
  19. package/skills/02_Cross-Domain_Foundation/cogsci-statistics/SKILL.md +361 -0
  20. package/skills/02_Cross-Domain_Foundation/cogsci-statistics/references/common-analyses.md +517 -0
  21. package/skills/02_Cross-Domain_Foundation/cogsci-visualization/SKILL.md +292 -0
  22. package/skills/02_Cross-Domain_Foundation/cogsci-visualization/references/plot-recipes.md +709 -0
  23. package/skills/02_Cross-Domain_Foundation/research-literacy/SKILL.md +286 -0
  24. package/skills/02_Cross-Domain_Foundation/research-literacy/references/common-assumptions.md +320 -0
  25. package/skills/02_Cross-Domain_Foundation/research-literacy/references/planning-template.md +143 -0
  26. package/skills/03_Cognitive_Psychology/alternative-uses-task-designer/SKILL.md +197 -0
  27. package/skills/03_Cognitive_Psychology/alternative-uses-task-designer/references/instruction-templates.md +60 -0
  28. package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/SKILL.md +246 -0
  29. package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/references/classic-paradigms.md +435 -0
  30. package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/references/design-principles.md +256 -0
  31. package/skills/03_Cognitive_Psychology/creativity-self-efficacy-mediation/SKILL.md +270 -0
  32. package/skills/03_Cognitive_Psychology/creativity-self-efficacy-mediation/references/lavaan-templates.md +172 -0
  33. package/skills/03_Cognitive_Psychology/divergent-thinking-scoring/SKILL.md +238 -0
  34. package/skills/03_Cognitive_Psychology/divergent-thinking-scoring/references/scoring-rubric.md +143 -0
  35. package/skills/03_Cognitive_Psychology/drift-diffusion-model/SKILL.md +203 -0
  36. package/skills/03_Cognitive_Psychology/drift-diffusion-model/references/fitting-guide.md +571 -0
  37. package/skills/03_Cognitive_Psychology/drift-diffusion-model/references/model-variants.md +427 -0
  38. package/skills/03_Cognitive_Psychology/evidence-accumulation-selector/SKILL.md +310 -0
  39. package/skills/03_Cognitive_Psychology/evidence-accumulation-selector/references/ez-diffusion-formulas.md +137 -0
  40. package/skills/03_Cognitive_Psychology/signal-detection-analysis/SKILL.md +300 -0
  41. package/skills/03_Cognitive_Psychology/signal-detection-analysis/references/application-guide.md +278 -0
  42. package/skills/03_Cognitive_Psychology/signal-detection-analysis/references/sdt-formulas.md +318 -0
  43. package/skills/03_Cognitive_Psychology/visual-search-array-generator/SKILL.md +283 -0
  44. package/skills/03_Cognitive_Psychology/visual-search-array-generator/references/array-generation-parameters.yaml +111 -0
  45. package/skills/04_Psycholinguistics/reading-time-analysis/SKILL.md +301 -0
  46. package/skills/04_Psycholinguistics/reading-time-analysis/references/measure-computation-guide.md +195 -0
  47. package/skills/04_Psycholinguistics/self-paced-reading-designer/SKILL.md +257 -0
  48. package/skills/04_Psycholinguistics/self-paced-reading-designer/references/analysis-guide.md +356 -0
  49. package/skills/04_Psycholinguistics/self-paced-reading-designer/references/region-segmentation.md +266 -0
  50. package/skills/04_Psycholinguistics/sentence-stimulus-norming/SKILL.md +346 -0
  51. package/skills/04_Psycholinguistics/sentence-stimulus-norming/references/lexical-databases-guide.md +184 -0
  52. package/skills/05_EEG_ERP/eeg-paradigm-designer/SKILL.md +226 -0
  53. package/skills/05_EEG_ERP/eeg-paradigm-designer/references/component-paradigm-map.md +276 -0
  54. package/skills/05_EEG_ERP/eeg-paradigm-designer/references/timing-parameters.md +244 -0
  55. package/skills/05_EEG_ERP/eeg-preprocessing-pipeline-guide/SKILL.md +367 -0
  56. package/skills/05_EEG_ERP/eeg-preprocessing-pipeline-guide/references/parameter-lookup-tables.md +138 -0
  57. package/skills/05_EEG_ERP/erp-analysis/SKILL.md +185 -0
  58. package/skills/05_EEG_ERP/erp-analysis/references/erp-components.md +447 -0
  59. package/skills/05_EEG_ERP/erp-analysis/references/preprocessing-pipeline.md +277 -0
  60. package/skills/05_EEG_ERP/erp-analysis/references/statistical-approaches.md +351 -0
  61. package/skills/05_EEG_ERP/mne-python-guide/SKILL.md +174 -0
  62. package/skills/05_EEG_ERP/mne-python-guide/references/decoding.md +178 -0
  63. package/skills/05_EEG_ERP/mne-python-guide/references/io_formats.md +160 -0
  64. package/skills/05_EEG_ERP/mne-python-guide/references/preprocessing.md +259 -0
  65. package/skills/05_EEG_ERP/mne-python-guide/references/simulation.md +173 -0
  66. package/skills/05_EEG_ERP/mne-python-guide/references/source_localization.md +234 -0
  67. package/skills/05_EEG_ERP/mne-python-guide/references/statistics.md +196 -0
  68. package/skills/05_EEG_ERP/mne-python-guide/references/time_frequency.md +165 -0
  69. package/skills/05_EEG_ERP/mne-python-guide/references/visualization.md +175 -0
  70. package/skills/06_fMRI_Neuroimaging/brain-connectivity-modeler/SKILL.md +317 -0
  71. package/skills/06_fMRI_Neuroimaging/brain-connectivity-modeler/references/method-implementation-guide.md +116 -0
  72. package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/SKILL.md +296 -0
  73. package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/references/design-matrix-guide.md +214 -0
  74. package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/references/statistical-inference.md +288 -0
  75. package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/SKILL.md +274 -0
  76. package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/references/quality-control.md +336 -0
  77. package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/references/step-by-step-pipeline.md +380 -0
  78. package/skills/06_fMRI_Neuroimaging/fmri-task-design-guide/SKILL.md +264 -0
  79. package/skills/06_fMRI_Neuroimaging/fmri-task-design-guide/references/design-optimization-examples.md +114 -0
  80. package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/SKILL.md +273 -0
  81. package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/references/decoding-methods.md +170 -0
  82. package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/references/rsa-guide.md +266 -0
  83. package/skills/06_fMRI_Neuroimaging/pycortex-guide/SKILL.md +123 -0
  84. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/database-subjects.md +179 -0
  85. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/dataset-types.md +208 -0
  86. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/freesurfer-fmriprep.md +162 -0
  87. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/mapping-transforms.md +181 -0
  88. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/mni-utils.md +207 -0
  89. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/surface-analysis.md +219 -0
  90. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/visualization.md +251 -0
  91. package/skills/07_Computational_Modeling/act-r-model-builder/SKILL.md +297 -0
  92. package/skills/07_Computational_Modeling/act-r-model-builder/references/model-patterns.md +197 -0
  93. package/skills/07_Computational_Modeling/act-r-model-builder/references/parameter-table.yaml +204 -0
  94. package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/SKILL.md +294 -0
  95. package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/references/diagnostics-checklist.md +351 -0
  96. package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/references/prior-selection-guide.md +241 -0
  97. package/skills/07_Computational_Modeling/parameter-recovery-checker/SKILL.md +269 -0
  98. package/skills/07_Computational_Modeling/parameter-recovery-checker/references/recovery-diagnostics.md +207 -0
  99. package/skills/08_Computational_Neuroscience/brain-connectivity-modeler/SKILL.md +317 -0
  100. package/skills/08_Computational_Neuroscience/brain-connectivity-modeler/references/method-implementation-guide.md +116 -0
  101. package/skills/08_Computational_Neuroscience/neural-decoding-analysis/SKILL.md +273 -0
  102. package/skills/08_Computational_Neuroscience/neural-decoding-analysis/references/decoding-methods.md +170 -0
  103. package/skills/08_Computational_Neuroscience/neural-decoding-analysis/references/rsa-guide.md +266 -0
  104. package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/SKILL.md +305 -0
  105. package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/references/data-requirements.md +60 -0
  106. package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/references/method-comparison.md +151 -0
  107. package/skills/08_Computational_Neuroscience/spiking-network-model-builder/SKILL.md +376 -0
  108. package/skills/08_Computational_Neuroscience/spiking-network-model-builder/references/hh-parameters.md +117 -0
  109. package/skills/08_Computational_Neuroscience/spiking-network-model-builder/references/network-regimes.md +130 -0
  110. package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/SKILL.md +258 -0
  111. package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/references/indicator-parameters.md +242 -0
  112. package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/references/pipeline-details.md +211 -0
  113. package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/SKILL.md +261 -0
  114. package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/references/opsin-catalog.md +124 -0
  115. package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/references/stimulation-parameters.md +304 -0
  116. package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/SKILL.md +367 -0
  117. package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/references/disconnection-guide.md +152 -0
  118. package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/references/vlsm-pipeline.md +182 -0
  119. package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/SKILL.md +250 -0
  120. package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/references/deficit-profiles.md +302 -0
  121. package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/references/test-catalog.md +304 -0
  122. package/skills/11_Developmental_Cognition/infant-looking-time-designer/SKILL.md +345 -0
  123. package/skills/11_Developmental_Cognition/infant-looking-time-designer/references/age-parameters.yaml +186 -0
  124. package/skills/12_Social_Cognition/tom-task-selector/SKILL.md +379 -0
  125. package/skills/12_Social_Cognition/tom-task-selector/references/task-database.md +317 -0
  126. package/skills/13_Visualization/nature-figure/README.md +442 -0
  127. package/skills/13_Visualization/nature-figure/SKILL.md +60 -0
  128. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-01-bar-charts.png +0 -0
  129. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-02-line-trends.png +0 -0
  130. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-03-heatmaps.png +0 -0
  131. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-04-scatter-bubble.png +0 -0
  132. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-05-radar-polar.png +0 -0
  133. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-06-distributions.png +0 -0
  134. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-07-forest-interval.png +0 -0
  135. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-08-area-stacked.png +0 -0
  136. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-09-image-plates.png +0 -0
  137. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-10-network-matrix.png +0 -0
  138. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_motivation.png +0 -0
  139. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_observation.png +0 -0
  140. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_observation_distillation.png +0 -0
  141. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_contrastive.png +0 -0
  142. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_results_CEDAR.png +0 -0
  143. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_results_IEDB.png +0 -0
  144. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_schematic.png +0 -0
  145. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/RNAGenScape_schematic.png +0 -0
  146. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/figures/ablation.png +0 -0
  147. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/figures/comparison.png +0 -0
  148. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/plot_ablation.py +86 -0
  149. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/plot_comparison.py +109 -0
  150. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/diffusion_swiss_roll.py +97 -0
  151. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/diffusion_swiss_roll.png +0 -0
  152. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.pdf +0 -0
  153. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.png +0 -0
  154. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.pdf +0 -0
  155. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.png +0 -0
  156. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.pdf +0 -0
  157. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.png +0 -0
  158. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_Ablation.py +64 -0
  159. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_GeneRegulatory.py +74 -0
  160. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_Trajectory.py +74 -0
  161. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/figures/idea.png +0 -0
  162. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/figures/illustration.png +0 -0
  163. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/plot_idea.py +76 -0
  164. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/plot_illustration.py +404 -0
  165. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_FPGM/figures/freq_prior.png +0 -0
  166. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_FPGM/plot_freq_prior.py +146 -0
  167. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_ablation_Cancer.png +0 -0
  168. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_ablation_IEDB.png +0 -0
  169. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_comparison_Cancer.png +0 -0
  170. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_comparison_IEDB.png +0 -0
  171. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/plot_bars.py +216 -0
  172. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/raw_data.py +125 -0
  173. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/manifold.png +0 -0
  174. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/manifold_holes.png +0 -0
  175. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_comparison_optimization.png +0 -0
  176. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_comparison_speed.png +0 -0
  177. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_sweep.png +0 -0
  178. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_comparison.py +228 -0
  179. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_hole_manifold.py +82 -0
  180. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_manifold.py +61 -0
  181. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_sweep.py +77 -0
  182. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/figures/comparison_posttraining.png +0 -0
  183. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/figures/comparison_radar.png +0 -0
  184. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/plot_comparison_radar.py +173 -0
  185. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/plot_posttraining.py +82 -0
  186. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/brute_force.png +0 -0
  187. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/correctness_by_category.png +0 -0
  188. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/correctness_by_subcategory.png +0 -0
  189. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/rewriting.png +0 -0
  190. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/selfcorrection_math.png +0 -0
  191. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_brute_force.py +248 -0
  192. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_correctness_by_category.py +132 -0
  193. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_correctness_by_subcategory.py +131 -0
  194. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_rewriting.py +105 -0
  195. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_selfcorrection_math.py +99 -0
  196. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/figures/composition_heatmap.png +0 -0
  197. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/figures/trend_by_month.png +0 -0
  198. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/plot_composition.py +81 -0
  199. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/plot_trend.py +125 -0
  200. package/skills/13_Visualization/nature-figure/assets/gallery/fig1-material-mechanism-rich.png +0 -0
  201. package/skills/13_Visualization/nature-figure/assets/gallery/fig2-spatial-imaging-rich.png +0 -0
  202. package/skills/13_Visualization/nature-figure/assets/gallery/fig3-in-vivo-efficacy-rich.png +0 -0
  203. package/skills/13_Visualization/nature-figure/assets/gallery/fig4-single-cell-systems-rich.png +0 -0
  204. package/skills/13_Visualization/nature-figure/assets/gallery/fig5-validation-perturbation-rich.png +0 -0
  205. package/skills/13_Visualization/nature-figure/evals/evals.json +37 -0
  206. package/skills/13_Visualization/nature-figure/manifest.yaml +57 -0
  207. package/skills/13_Visualization/nature-figure/references/api.md +428 -0
  208. package/skills/13_Visualization/nature-figure/references/backend-selection.md +100 -0
  209. package/skills/13_Visualization/nature-figure/references/chart-types.md +281 -0
  210. package/skills/13_Visualization/nature-figure/references/common-patterns.md +350 -0
  211. package/skills/13_Visualization/nature-figure/references/demos.md +65 -0
  212. package/skills/13_Visualization/nature-figure/references/design-theory.md +436 -0
  213. package/skills/13_Visualization/nature-figure/references/figure-contract.md +93 -0
  214. package/skills/13_Visualization/nature-figure/references/nature-2026-observations.md +112 -0
  215. package/skills/13_Visualization/nature-figure/references/qa-contract.md +119 -0
  216. package/skills/13_Visualization/nature-figure/references/r-template-index.md +66 -0
  217. package/skills/13_Visualization/nature-figure/references/r-workflow.md +161 -0
  218. package/skills/13_Visualization/nature-figure/references/tutorials.md +251 -0
  219. package/skills/13_Visualization/nature-figure/static/core/contract.md +29 -0
  220. package/skills/13_Visualization/nature-figure/static/core/stance.md +37 -0
  221. package/skills/13_Visualization/nature-figure/static/fragments/backend/python.md +37 -0
  222. package/skills/13_Visualization/nature-figure/static/fragments/backend/r.md +44 -0
  223. package/skills/14_Writing/markdown-report-writing/SKILL.md +306 -0
  224. package/skills/14_Writing/markdown-report-writing/references/compatibility-matrix.md +72 -0
  225. package/skills/14_Writing/markdown-report-writing/references/templates.md +299 -0
  226. package/skills/15_Others/neuroimaging-power-guide/SKILL.md +324 -0
  227. package/skills/15_Others/neuroimaging-power-guide/references/effect-size-lookup-tables.md +102 -0
  228. package/skills/15_Others/neuroimaging-sample-size-calculator/SKILL.md +330 -0
  229. package/skills/15_Others/neuroimaging-sample-size-calculator/references/worked-examples.md +220 -0
@@ -0,0 +1,273 @@
1
+ ---
2
+ name: "neural-decoding-analysis"
3
+ description: "Domain-validated methods and decision logic for neural decoding, RSA, temporal generalization, and encoding models in systems neuroscience"
4
+ domain: "systems-neuroscience"
5
+ version: "1.0.0"
6
+ authors:
7
+ - "Claude Code Skill Generator"
8
+ papers:
9
+ - "Kriegeskorte et al., 2008"
10
+ - "Haynes, 2015"
11
+ - "King & Dehaene, 2014"
12
+ - "Grootswagers et al., 2017"
13
+ - "Varoquaux et al., 2017"
14
+ dependencies:
15
+ required:
16
+ - research-literacy
17
+ recommended:
18
+ - fmri-preprocessing-pipeline-guide
19
+ review_status: "ai-generated"
20
+ ---
21
+
22
+ # Neural Population Decoding Analysis
23
+
24
+ ## Purpose
25
+
26
+ This skill encodes expert methodological knowledge for multivariate neural decoding analyses in systems neuroscience. It covers cross-validated classification (MVPA), representational similarity analysis (RSA), temporal generalization, and encoding models. The skill provides domain-specific decision logic, parameter recommendations, and pitfall warnings that a machine-learning engineer without neuroscience training would not know.
27
+
28
+ ## When to Use This Skill
29
+
30
+ - Determining whether stimulus or task information is represented in neural population activity
31
+ - Comparing the representational geometry of brain regions to computational models
32
+ - Characterizing the temporal dynamics of neural representations from EEG/MEG
33
+ - Building encoding models to predict neural responses from stimulus features
34
+ - Designing a decoding analysis pipeline and choosing appropriate methods and parameters
35
+
36
+ ## Research Planning Protocol
37
+
38
+ Before executing the domain-specific steps below, you MUST:
39
+
40
+ 1. **State the research question** — What specific representational or informational question is this decoding analysis addressing?
41
+ 2. **Justify the method choice** — Why decoding/RSA (not univariate analysis, connectivity, etc.)? What alternatives were considered?
42
+ 3. **Declare expected outcomes** — What decoding accuracy or representational structure would support vs. refute the hypothesis?
43
+ 4. **Note assumptions and limitations** — What does this method assume? Where could it mislead (e.g., confounds, leakage)?
44
+ 5. **Present the plan to the user and WAIT for confirmation** before proceeding.
45
+
46
+ For detailed methodology guidance, see the `research-literacy` skill.
47
+
48
+
49
+ ## ⚠️ Verification Notice
50
+
51
+ This skill was generated by AI from academic literature. All parameters, thresholds, and citations require independent verification before use in research. If you find errors, please [open an issue](https://github.com/HaoxuanLiTHUAI/awesome_cognitive_and_neuroscience_skills/issues).
52
+
53
+ ## When to Use Decoding vs. Univariate Analysis
54
+
55
+ Univariate analysis tests whether the *mean activity level* differs across conditions in a region. Decoding tests whether *spatial patterns of activity* carry information, even when mean activity is identical across conditions (Haynes, 2015). Use decoding when:
56
+
57
+ - You expect information to be encoded in distributed patterns, not mean amplitude
58
+ - The signal-to-noise ratio per voxel/channel is low but the population carries information
59
+ - You want to compare neural representations to computational model predictions (use RSA)
60
+ - You want to track when information emerges and transforms over time (use temporal generalization)
61
+
62
+ > **Domain judgment**: High decoding accuracy does NOT mean the decoded region is the *source* of the representation. It means the information is *accessible* from that region's patterns. A downstream region receiving a copy of the signal will also decode well (Haynes, 2015).
63
+
64
+ ## Method Selection Decision Tree
65
+
66
+ ```
67
+ What is your research question?
68
+ |
69
+ +-- "Is stimulus/task information present in this brain region's patterns?"
70
+ | --> Cross-validated classification (MVPA)
71
+ | Output: classification accuracy or d-prime
72
+ |
73
+ +-- "How are representations organized? Does the geometry match a model?"
74
+ | --> Representational Similarity Analysis (RSA)
75
+ | Output: model-RDM correlation, noise ceiling
76
+ |
77
+ +-- "When does information emerge and how does it transform over time?"
78
+ | --> Temporal Generalization (time x time decoding)
79
+ | Output: temporal generalization matrix
80
+ | Best for: EEG, MEG, intracranial recordings
81
+ |
82
+ +-- "What stimulus features drive neural responses across the feature space?"
83
+ --> Encoding Models (voxelwise/channel-wise prediction)
84
+ Output: prediction accuracy (R^2), feature tuning maps
85
+ ```
86
+
87
+ ## Cross-Validated Classification (MVPA)
88
+
89
+ ### Classifier Selection
90
+
91
+ | Classifier | When to Use | When to Avoid | Source |
92
+ |---|---|---|---|
93
+ | **Linear SVM** | Default choice; robust to high dimensionality; works well with small samples | When you need probabilistic outputs (use logistic regression) | Misaki et al., 2010; Varoquaux et al., 2017 |
94
+ | **LDA** | Fast; good when n_features << n_samples after reduction | Raw high-dimensional data (covariance estimate unstable) | Misaki et al., 2010 |
95
+ | **Logistic Regression** | When you need class probabilities; with L1 for sparse solutions | Rarely a bad choice; comparable to linear SVM | Varoquaux et al., 2017 |
96
+ | **Linear kernel (general)** | Almost always for fMRI/EEG | Nonlinear kernels rarely improve and risk overfitting | Misaki et al., 2010 |
97
+
98
+ > **Domain judgment**: Linear classifiers are strongly preferred in neuroimaging because (1) fMRI/EEG patterns are high-dimensional relative to sample size, making nonlinear methods prone to overfitting, and (2) linear weights are more interpretable neurally, though see Haufe et al. (2014) on the distinction between classifier weights and activation patterns.
99
+
100
+ ### Cross-Validation Strategy
101
+
102
+ | Strategy | When to Use | Rationale |
103
+ |---|---|---|
104
+ | **Leave-one-run-out** | fMRI (standard) | Respects temporal autocorrelation within runs; prevents leakage from slow hemodynamic signals (Varoquaux et al., 2017) |
105
+ | **Stratified k-fold** (k=5-10) | EEG/MEG with many trials | Balances class proportions in each fold; k=5 recommended for bias-variance tradeoff (Varoquaux, 2018) |
106
+ | **Leave-one-trial-out** | When few trials available | Maximum training data but high variance; avoid for fMRI due to temporal autocorrelation (Varoquaux et al., 2017) |
107
+ | **Leave-one-subject-out** | Between-subject generalization | Tests whether patterns generalize across individuals |
108
+
109
+ > **CRITICAL -- Information leakage**: Feature selection, normalization, and dimensionality reduction MUST be performed WITHIN each cross-validation fold, using ONLY training data. Fitting a PCA or z-scoring across all data before splitting inflates accuracy by leaking test-set statistics into training (Kriegeskorte et al., 2009; Varoquaux et al., 2017).
110
+
111
+ ### Chance Level and Statistical Testing
112
+
113
+ - **Theoretical chance**: 1/n_classes for balanced designs (e.g., 50% for 2-class)
114
+ - **CRITICAL**: Theoretical chance is only valid with infinite samples. With small samples, empirical accuracy on random data can substantially exceed 1/n_classes (Combrisson & Jerbi, 2015)
115
+ - **Use permutation testing**: Shuffle labels 1000+ times, decode each permutation, compute p-value as the proportion of permuted accuracies >= observed accuracy (Combrisson & Jerbi, 2015)
116
+ - **Binomial test**: Acceptable quick alternative for large trial counts, but permutation testing is preferred (Combrisson & Jerbi, 2015)
117
+ - For group-level inference: test accuracy against chance across subjects using a one-sample t-test or Wilcoxon signed-rank test on subject-level accuracies
118
+
119
+ ### Minimum Data Requirements
120
+
121
+ - **Trials per class**: Minimum **20-30 trials per class** for reliable within-subject decoding (Varoquaux, 2018; Grootswagers et al., 2017)
122
+ - **Cross-validation error bars**: With ~100 samples, expect confidence intervals of approximately +/-10% on accuracy estimates (Varoquaux, 2018)
123
+ - **Trial averaging**: Averaging 5-10 trials before classification improves SNR but reduces effective sample size; balance based on total trial count (Grootswagers et al., 2017)
124
+
125
+ ## Representational Similarity Analysis (RSA)
126
+
127
+ RSA abstracts from activity patterns to a condition-by-condition dissimilarity matrix (RDM), enabling comparison across brain regions, species, and computational models (Kriegeskorte et al., 2008).
128
+
129
+ ### RDM Construction
130
+
131
+ | Distance Metric | Properties | When to Use | Source |
132
+ |---|---|---|---|
133
+ | **Correlation distance** (1 - Pearson r) | Invariant to mean and scale | Default for comparing pattern shape; standard in early RSA | Kriegeskorte et al., 2008 |
134
+ | **Euclidean distance** | Sensitive to amplitude | When amplitude differences are meaningful | Kriegeskorte et al., 2008 |
135
+ | **Crossnobis distance** | Cross-validated Mahalanobis; unbiased estimator with interpretable zero | **Preferred for inferential statistics**; requires multi-run data | Walther et al., 2016; Kriegeskorte & Diedrichsen, 2019 |
136
+
137
+ > **Domain judgment**: The crossnobis estimator is unbiased -- its expected value is zero when two conditions have identical representations, unlike correlation distance or Euclidean distance which are positively biased by noise. This means crossnobis values can be negative (not a true distance), but this property makes it valid for statistical inference without bias correction (Walther et al., 2016).
138
+
139
+ ### Model Comparison
140
+
141
+ - **Pearson/Spearman correlation**: Correlate model RDM with brain RDM (use Spearman for robustness to outliers; Nili et al., 2014)
142
+ - **Partial correlation**: Control for one model while testing another (essential when models are correlated)
143
+ - **Regression on RDMs**: Fit multiple model RDMs simultaneously; use weighted least squares or component models (Kriegeskorte & Diedrichsen, 2019)
144
+
145
+ ### Statistical Inference
146
+
147
+ - **Noise ceiling**: Upper and lower bounds on the best achievable model fit given between-subject variability. Upper bound: average correlation of each subject's RDM with the group mean RDM. Lower bound: same but computed with leave-one-subject-out (Nili et al., 2014)
148
+ - **Stimulus-label randomization**: Permute condition labels to construct a null distribution for RDM correlation (Nili et al., 2014)
149
+ - **Bootstrap confidence intervals**: Resample subjects with replacement to estimate confidence intervals on model-RDM correlations
150
+
151
+ > **Domain judgment**: If a model falls within the noise ceiling, it explains as much variance as is explainable given the noise in the data. A model below the lower bound leaves systematic variance unexplained. This is NOT the same as a significance test -- a model can be significantly correlated with brain RDMs yet still fall below the noise ceiling (Nili et al., 2014).
152
+
153
+ See `references/rsa-guide.md` for a complete step-by-step RSA workflow.
154
+
155
+ ## Temporal Generalization (EEG/MEG)
156
+
157
+ Train a classifier at each time point t, test it at every time point t'. The resulting time x time matrix reveals the dynamics of neural representations (King & Dehaene, 2014).
158
+
159
+ ### Interpreting the Temporal Generalization Matrix
160
+
161
+ | Pattern | Matrix Shape | Interpretation | Example |
162
+ |---|---|---|---|
163
+ | **Diagonal only** | Thin diagonal stripe | Information is present but the neural code changes over time (chain of transient states) | Sequence of processing stages |
164
+ | **Square block** | Broad off-diagonal generalization | Stable, sustained representation (same code maintained) | Working memory maintenance |
165
+ | **Off-diagonal stripe** | Horizontal or vertical extension | A code trained at one time reactivates later | Memory reactivation |
166
+ | **Below-diagonal spread** | Widening below diagonal | Later representations are decodable by earlier classifiers (persistent code) | Sustained sensory trace |
167
+
168
+ (King & Dehaene, 2014; Grootswagers et al., 2017)
169
+
170
+ ### Sliding Window Parameters
171
+
172
+ | Parameter | Recommended Value | Rationale | Source |
173
+ |---|---|---|---|
174
+ | Window width | **50 ms** for EEG/MEG | Balances temporal resolution with SNR | Grootswagers et al., 2017 |
175
+ | Step size | **10 ms** for EEG/MEG | Provides smooth temporal profile without excessive computation | Grootswagers et al., 2017 |
176
+ | Baseline window | **-200 to 0 ms** | Standard pre-stimulus baseline | Grootswagers et al., 2017 |
177
+ | Features | All sensors at time point t | Use all channels; spatial patterns carry information | King & Dehaene, 2014 |
178
+
179
+ ### Statistical Testing for Temporal Generalization
180
+
181
+ - **Cluster-based permutation test** on the time x time matrix (Maris & Oostenveld, 2007)
182
+ - Cluster-forming threshold: **p < 0.05** (two-tailed) at the individual time-point level; correct at cluster level with **1000+ permutations**
183
+ - **Caution**: Cluster tests control family-wise error rate but do NOT localize the effect to specific time points (Maris & Oostenveld, 2007)
184
+
185
+ ## Encoding Models
186
+
187
+ Encoding models predict neural responses from stimulus features, complementing decoding (which predicts stimuli from neural responses).
188
+
189
+ ### When to Use Encoding Over Decoding
190
+
191
+ - When the feature space is continuous or high-dimensional (e.g., image pixels, spectrograms)
192
+ - When you want to characterize *what features* a region encodes, not just *whether* it encodes information
193
+ - Voxelwise encoding models: fit a regularized regression (ridge) from features to each voxel's response (Kriegeskorte & Diedrichsen, 2019)
194
+
195
+ ### Key Considerations
196
+
197
+ - **Regularization**: Ridge regression (L2) is standard; prevents overfitting when features > samples
198
+ - **Cross-validation**: Leave-one-run-out; evaluate with Pearson correlation between predicted and actual responses
199
+ - **Feature spaces**: Gabor wavelets (V1), DNN layers (ventral stream), semantic embeddings (language regions)
200
+ - **Relationship to RSA**: When using a zero-mean isotropic Gaussian weight prior (ridge regression), encoding models, RSA, and pattern component models test equivalent hypotheses captured by the second moment matrix G (Kriegeskorte & Diedrichsen, 2019)
201
+
202
+ ## Common Pitfalls
203
+
204
+ ### 1. Information Leakage (The Most Common Error)
205
+
206
+ Feature selection, z-scoring, PCA, or any data-driven preprocessing on the full dataset before cross-validation splitting will leak information from test folds into training, inflating accuracy. ALL such steps must occur WITHIN each fold (Kriegeskorte et al., 2009; Varoquaux et al., 2017).
207
+
208
+ ### 2. Confounds Driving Decoding
209
+
210
+ Decoding "success" may reflect confounds rather than neural representations:
211
+ - **Eye movements**: Systematic gaze differences between conditions produce decodable EOG artifacts in EEG and BOLD signal differences near the eyes in fMRI
212
+ - **Reaction time differences**: Conditions with different RTs produce different motor preparation signals
213
+ - **Head motion**: Differential motion across conditions (e.g., speech vs. rest) introduces confounded spatial patterns
214
+ - **Run order**: If conditions are blocked or ordered within runs, slow signal drifts can drive classification
215
+
216
+ ### 3. Interpreting Accuracy Magnitude
217
+
218
+ - Decoding accuracy reflects information *accessible to the classifier*, not the *amount* of neural information (Haynes, 2015)
219
+ - Low accuracy does not mean low information (features may be nonlinearly coded)
220
+ - High accuracy does not imply the region is the *origin* of the representation
221
+ - **Never compare accuracy magnitudes across regions with different voxel counts**, SNR, or dimensionality without controlling for these factors
222
+
223
+ ### 4. Double-Dipping in Searchlight Analysis
224
+
225
+ Selecting an ROI based on significant searchlight clusters and then performing additional analyses on those clusters is circular (Kriegeskorte et al., 2009; Etzel et al., 2013). Use independent data or pre-registered ROIs for follow-up analyses.
226
+
227
+ ### 5. Classifier Weights Are Not Activation Patterns
228
+
229
+ Raw SVM or regression weights do NOT indicate which voxels/channels are most *activated* by a condition. They indicate which features are most useful for *discrimination*, which can include suppressing noise. To obtain neurophysiologically interpretable maps, transform weights into activation patterns using the method of Haufe et al. (2014).
230
+
231
+ ### 6. Imbalanced Classes
232
+
233
+ Unequal trial counts across classes bias accuracy toward the majority class. Solutions:
234
+ - Undersample the majority class
235
+ - Use balanced accuracy (average of per-class recall)
236
+ - Stratify cross-validation folds
237
+
238
+ ## Minimum Reporting Checklist
239
+
240
+ Based on Haynes (2015), Varoquaux et al. (2017), and Grootswagers et al. (2017):
241
+
242
+ - [ ] Classifier type and hyperparameters (e.g., linear SVM, C=1)
243
+ - [ ] Cross-validation scheme (e.g., leave-one-run-out, 5-fold stratified)
244
+ - [ ] Feature space (number of voxels/channels, ROI definition or searchlight radius)
245
+ - [ ] Preprocessing steps performed WITHIN vs. OUTSIDE cross-validation folds
246
+ - [ ] Number of trials/samples per class per subject
247
+ - [ ] Statistical test for significance (permutation test with N permutations, or parametric test)
248
+ - [ ] Effect size or confidence intervals on accuracy
249
+ - [ ] For RSA: distance metric, model RDMs tested, noise ceiling
250
+ - [ ] For temporal generalization: window width, step size, cluster-correction parameters
251
+ - [ ] Software and version used
252
+
253
+ ## Key References
254
+
255
+ - Combrisson, E., & Jerbi, K. (2015). Exceeding chance level by chance: The caveat of theoretical chance levels in brain signal classification and statistical assessment of decoding accuracy. *Journal of Neuroscience Methods*, 250, 126-136.
256
+ - Etzel, J. A., Zacks, J. M., & Braver, T. S. (2013). Searchlight analysis: Promise, pitfalls, and potential. *NeuroImage*, 78, 261-269.
257
+ - Grootswagers, T., Wardle, S. G., & Carlson, T. A. (2017). Decoding dynamic brain patterns from evoked responses: A tutorial on multivariate pattern analysis applied to time series neuroimaging data. *Journal of Cognitive Neuroscience*, 29(4), 677-697.
258
+ - Haufe, S., et al. (2014). On the interpretation of weight vectors of linear models in multivariate neuroimaging. *NeuroImage*, 87, 96-110.
259
+ - Haynes, J.-D. (2015). A primer on pattern-based approaches to fMRI: Principles, pitfalls, and perspectives. *Neuron*, 87(2), 257-270.
260
+ - King, J.-R., & Dehaene, S. (2014). Characterizing the dynamics of mental representations: The temporal generalization method. *Trends in Cognitive Sciences*, 18(4), 203-210.
261
+ - Kriegeskorte, N., Goebel, R., & Bandettini, P. (2006). Information-based functional brain mapping. *Proceedings of the National Academy of Sciences*, 103(10), 3863-3868.
262
+ - Kriegeskorte, N., Mur, M., & Bandettini, P. (2008). Representational similarity analysis -- Connecting the branches of systems neuroscience. *Frontiers in Systems Neuroscience*, 2, 4.
263
+ - Kriegeskorte, N., Simmons, W. K., Bellgowan, P. S., & Baker, C. I. (2009). Circular analysis in systems neuroscience: The dangers of double dipping. *Nature Neuroscience*, 12(5), 535-540.
264
+ - Kriegeskorte, N., & Diedrichsen, J. (2019). Peeling the onion of brain representations. *Annual Review of Neuroscience*, 42, 407-432.
265
+ - Maris, E., & Oostenveld, R. (2007). Nonparametric statistical testing of EEG- and MEG-data. *Journal of Neuroscience Methods*, 164(1), 177-190.
266
+ - Misaki, M., Kim, Y., Bandettini, P. A., & Kriegeskorte, N. (2010). Comparison of multivariate classifiers and response normalizations for pattern-information fMRI. *NeuroImage*, 53(1), 103-118.
267
+ - Nili, H., et al. (2014). A toolbox for representational similarity analysis. *PLoS Computational Biology*, 10(4), e1003553.
268
+ - Varoquaux, G., et al. (2017). Assessing and tuning brain decoders: Cross-validation, caveats, and guidelines. *NeuroImage*, 145, 166-179.
269
+ - Varoquaux, G. (2018). Cross-validation failure: Small sample sizes lead to large error bars. *NeuroImage*, 180, 68-77.
270
+ - Walther, A., et al. (2016). Reliability of dissimilarity measures for multi-voxel pattern analysis. *NeuroImage*, 137, 188-200.
271
+
272
+ See `references/decoding-methods.md` for detailed classifier comparisons, searchlight parameters, and software tools.
273
+ See `references/rsa-guide.md` for a complete step-by-step RSA analysis workflow.
@@ -0,0 +1,170 @@
1
+ # Decoding Methods: Detailed Classifier Comparisons, Searchlight Parameters, and Tools
2
+
3
+ This reference document supplements `SKILL.md` with extended details on classifier selection, searchlight analysis, feature selection, hyperparameter tuning, and software tools for neural decoding.
4
+
5
+ ## Classifier Comparison
6
+
7
+ ### Linear SVM
8
+
9
+ - **Mechanism**: Finds the maximum-margin hyperplane separating classes in feature space
10
+ - **Regularization**: Controlled by parameter C (inverse regularization strength). Default C=1 is appropriate for most neuroimaging applications (Misaki et al., 2010; Varoquaux et al., 2017)
11
+ - **Strengths**: Robust to high-dimensional data (n_features >> n_samples); well-suited for fMRI where voxel count vastly exceeds trial count; regularization handles collinear features
12
+ - **Weaknesses**: No native probability estimates (use Platt scaling if needed, but this adds a calibration step); sensitive to C parameter when data is noisy
13
+ - **Typical neuroimaging performance**: Among the best linear classifiers for fMRI pattern classification (Misaki et al., 2010)
14
+
15
+ ### Linear Discriminant Analysis (LDA)
16
+
17
+ - **Mechanism**: Projects data onto the direction that maximizes between-class variance relative to within-class variance, assuming Gaussian class distributions with shared covariance
18
+ - **Regularization**: Shrinkage of covariance matrix toward identity (Ledoit-Wolf shrinkage recommended); critical when n_features > n_samples
19
+ - **Strengths**: Fast to train and test; provides a natural decision boundary; works well after dimensionality reduction
20
+ - **Weaknesses**: Unreliable without dimensionality reduction or regularization when voxel count exceeds sample count; assumes equal covariance across classes (Misaki et al., 2010)
21
+ - **When to use**: After PCA or feature selection has reduced dimensionality; for EEG/MEG where channel count is moderate (~64-306 channels)
22
+
23
+ ### Logistic Regression
24
+
25
+ - **Mechanism**: Models the log-odds of class membership as a linear function of features
26
+ - **Regularization**: L2 (ridge) penalty is default; L1 (lasso) produces sparse solutions identifying a subset of informative features
27
+ - **Strengths**: Provides calibrated probability estimates; L1 variant enables feature selection; comparable performance to linear SVM (Varoquaux et al., 2017)
28
+ - **Weaknesses**: L1 solutions are unstable when features are highly correlated (as in fMRI); selected voxels may not be neurophysiologically meaningful
29
+ - **When to use**: When probability outputs are needed (e.g., for confidence-weighted analyses); when L1 sparsity is desired for interpretability (with caveats)
30
+
31
+ ### Gaussian Naive Bayes (GNB)
32
+
33
+ - **Mechanism**: Assumes features are independently Gaussian-distributed within each class
34
+ - **Strengths**: Extremely fast; no hyperparameters to tune
35
+ - **Weaknesses**: The independence assumption is strongly violated in neuroimaging data (neighboring voxels are correlated); generally performs significantly worse than SVM, LDA, and logistic regression for fMRI (Misaki et al., 2010)
36
+ - **When to use**: As a quick sanity check or baseline; avoid for primary analyses
37
+
38
+ ### Nonlinear Classifiers (RBF SVM, Random Forest, Neural Networks)
39
+
40
+ - **General guidance**: Nonlinear classifiers rarely outperform linear classifiers for typical neuroimaging classification because the feature space is high-dimensional relative to the number of training samples (Misaki et al., 2010)
41
+ - **Exception**: May be useful with very large datasets (e.g., thousands of trials pooled across subjects) or when representations are known to be nonlinearly organized
42
+ - **Risk**: Overfitting is severe with small neuroimaging samples; results are harder to interpret neurally
43
+
44
+ ### Summary Comparison Table
45
+
46
+ | Classifier | Speed (train) | Probability output | Feature selection | Typical accuracy rank | Recommended for |
47
+ |---|---|---|---|---|---|
48
+ | Linear SVM | Medium | No (without Platt) | Via weight magnitude | 1st-2nd | fMRI ROI, searchlight |
49
+ | LDA (shrinkage) | Fast | Yes | No | 1st-2nd | EEG/MEG time-resolved |
50
+ | Logistic (L2) | Medium | Yes | No | 1st-2nd | General purpose |
51
+ | Logistic (L1) | Slow | Yes | Yes (sparse) | 2nd-3rd | Feature identification |
52
+ | GNB | Very fast | Yes | No | Last | Quick sanity check |
53
+ | RBF SVM | Slow | No | No | Variable | Large datasets only |
54
+
55
+ (Rankings based on Misaki et al., 2010; Varoquaux et al., 2017)
56
+
57
+ ## Searchlight Analysis
58
+
59
+ ### Overview
60
+
61
+ Searchlight analysis (Kriegeskorte et al., 2006) maps information content across the brain by applying multivariate classification to a small sphere of voxels centered on each brain voxel, producing a whole-brain accuracy map.
62
+
63
+ ### Parameters
64
+
65
+ | Parameter | Recommended Value | Rationale | Source |
66
+ |---|---|---|---|
67
+ | **Sphere radius** | **3-4 voxels** (e.g., 4 mm for 2 mm isovoxels) | Balances spatial specificity with sufficient features; 4 mm radius yields ~100-120 voxels per searchlight | Kriegeskorte et al., 2006 |
68
+ | **Classifier** | Linear SVM or LDA | Fast classifiers essential given thousands of searchlight positions | Misaki et al., 2010 |
69
+ | **Cross-validation** | Leave-one-run-out | Respects temporal structure of fMRI data | Varoquaux et al., 2017 |
70
+ | **Correction for multiple comparisons** | Cluster-based permutation or TFCE | Searchlight maps are spatially smooth; voxelwise FWE is overly conservative | Etzel et al., 2013 |
71
+ | **Chance level map** | Subtract 1/n_classes or use permutation-based null | Raw accuracy maps are biased; always subtract chance or z-score | Combrisson & Jerbi, 2015 |
72
+
73
+ ### Searchlight Pitfalls
74
+
75
+ 1. **Spatial blurring**: The accuracy at each voxel reflects information in the entire sphere, not just the center voxel. Clusters in searchlight maps are larger than the true informative region (Etzel et al., 2013)
76
+ 2. **Center bias**: Voxels near the center of a large informative region get high accuracy because their spheres overlap maximally with the informative area; edge voxels get lower accuracy even if equally informative
77
+ 3. **Double-dipping**: Selecting ROIs based on searchlight maps and then performing further analyses on those ROIs using the same data is circular (Kriegeskorte et al., 2009). Use independent data for follow-up
78
+ 4. **Variable SNR**: Searchlights near brain edges contain fewer grey-matter voxels, reducing effective feature dimensionality and potentially accuracy. Use a grey-matter mask
79
+
80
+ ## Feature Selection Methods
81
+
82
+ Feature selection can improve decoding by removing noisy features, but MUST be performed within each cross-validation fold.
83
+
84
+ ### ANOVA-Based Selection
85
+
86
+ - Compute a one-way ANOVA F-statistic for each feature (voxel/channel) using training data
87
+ - Select the top k features by F-value (typical: top **500-2000 voxels** for whole-brain fMRI; Haynes, 2015)
88
+ - Fast and effective; widely used in fMRI MVPA
89
+ - **Critical**: Compute ANOVA on training data only; selecting on all data leaks information (Kriegeskorte et al., 2009)
90
+
91
+ ### Recursive Feature Elimination (RFE)
92
+
93
+ - Iteratively remove the least informative features based on classifier weights
94
+ - Computationally expensive; requires re-training at each elimination step
95
+ - Can improve accuracy but increases risk of overfitting to the cross-validation structure
96
+ - Use only when theoretical motivation exists for sparse feature selection
97
+
98
+ ### Anatomical ROI Selection
99
+
100
+ - Pre-define ROIs using anatomical atlases or functional localizers from independent data
101
+ - Avoids the circularity of data-driven feature selection entirely
102
+ - **Preferred** when you have strong anatomical hypotheses (Haynes, 2015)
103
+
104
+ ### PCA/ICA-Based Dimensionality Reduction
105
+
106
+ - PCA: Retain components explaining **95-99%** of variance (community convention; no single citation)
107
+ - ICA: Use independent components as features; more common for EEG/MEG
108
+ - **Critical**: Fit PCA/ICA on training data only, then transform test data with the training-data projection
109
+
110
+ ## Hyperparameter Tuning
111
+
112
+ ### General Principle
113
+
114
+ **Never optimize hyperparameters on the test set.** Use nested cross-validation: the inner loop tunes hyperparameters, the outer loop evaluates generalization (Varoquaux et al., 2017).
115
+
116
+ ### SVM C Parameter
117
+
118
+ - **Default C=1** works well for most neuroimaging applications (Varoquaux et al., 2017)
119
+ - If tuning: search over C = {0.001, 0.01, 0.1, 1, 10, 100} in inner cross-validation fold
120
+ - Sane defaults often outperform tuned parameters when sample sizes are small, because nested cross-validation has even smaller training sets (Varoquaux et al., 2017)
121
+
122
+ ### Number of Cross-Validation Folds
123
+
124
+ - **k=5** provides a good bias-variance tradeoff for accuracy estimation (Varoquaux, 2018)
125
+ - **Leave-one-out** is unbiased but high variance; leads to unstable estimates (Varoquaux et al., 2017)
126
+ - For fMRI, leave-one-run-out is dictated by the data structure (typically 4-12 runs, so k=4-12)
127
+ - **Repeat** random splits 10-100 times to stabilize estimates when using k-fold (Varoquaux et al., 2017)
128
+
129
+ ## Software Tools
130
+
131
+ ### Python Ecosystem
132
+
133
+ | Tool | Primary Use | URL |
134
+ |---|---|---|
135
+ | **scikit-learn** | General ML: classifiers, cross-validation, feature selection, permutation testing | scikit-learn.org |
136
+ | **Nilearn** | fMRI decoding, searchlight, ROI-based MVPA, brain visualization | nilearn.github.io |
137
+ | **MNE-Python** | EEG/MEG decoding, temporal generalization, sensor-space MVPA | mne.tools |
138
+ | **rsatoolbox** (Python) | RSA: RDM construction, model comparison, noise ceiling, visualization | rsatoolbox.readthedocs.io |
139
+ | **PyMVPA** | Full MVPA pipeline for fMRI; searchlight, cross-validation, feature selection | pymvpa.org |
140
+ | **BrainIAK** | Advanced fMRI analysis: SRM, HTFA, MVPA, connectivity | brainiak.org |
141
+
142
+ ### MATLAB Ecosystem
143
+
144
+ | Tool | Primary Use | URL |
145
+ |---|---|---|
146
+ | **CoSMoMVPA** | Comprehensive MVPA toolbox for fMRI, EEG, MEG; searchlight, RSA | cosmomvpa.org |
147
+ | **The Decoding Toolbox (TDT)** | fMRI MVPA with SPM integration; decoding, RSA, reconstruction | tdt.sourceforge.net |
148
+ | **RSA Toolbox** (MATLAB) | RSA: RDM construction, model testing, noise ceiling, visualization | github.com/rsagroup/rsatoolbox |
149
+ | **MVPA-Light** | Classification and regression for multi-dimensional data; EEG/MEG focus | github.com/treder/MVPA-Light |
150
+ | **FieldTrip** | EEG/MEG analysis including MVPA and temporal generalization | fieldtriptoolbox.org |
151
+ | **ADAM Toolbox** | EEG MVPA: temporal generalization, group statistics | github.com/fahrenfort/ADAM |
152
+
153
+ ### Tool Selection Guidance
154
+
155
+ - **fMRI, Python**: Nilearn + scikit-learn for standard MVPA; rsatoolbox for RSA
156
+ - **fMRI, MATLAB**: CoSMoMVPA or TDT (integrates with SPM)
157
+ - **EEG/MEG, Python**: MNE-Python for temporal decoding and RSA
158
+ - **EEG/MEG, MATLAB**: CoSMoMVPA, MVPA-Light, or FieldTrip
159
+ - **RSA specifically**: rsatoolbox (Python) or RSA Toolbox (MATLAB) by Kriegeskorte/Nili
160
+
161
+ ## References
162
+
163
+ - Combrisson, E., & Jerbi, K. (2015). Exceeding chance level by chance. *J. Neurosci. Methods*, 250, 126-136.
164
+ - Etzel, J. A., Zacks, J. M., & Braver, T. S. (2013). Searchlight analysis: Promise, pitfalls, and potential. *NeuroImage*, 78, 261-269.
165
+ - Haynes, J.-D. (2015). A primer on pattern-based approaches to fMRI. *Neuron*, 87(2), 257-270.
166
+ - Kriegeskorte, N., Goebel, R., & Bandettini, P. (2006). Information-based functional brain mapping. *PNAS*, 103(10), 3863-3868.
167
+ - Kriegeskorte, N., et al. (2009). Circular analysis in systems neuroscience. *Nat. Neurosci.*, 12(5), 535-540.
168
+ - Misaki, M., Kim, Y., Bandettini, P. A., & Kriegeskorte, N. (2010). Comparison of multivariate classifiers and response normalizations for pattern-information fMRI. *NeuroImage*, 53(1), 103-118.
169
+ - Varoquaux, G., et al. (2017). Assessing and tuning brain decoders. *NeuroImage*, 145, 166-179.
170
+ - Varoquaux, G. (2018). Cross-validation failure: Small sample sizes lead to large error bars. *NeuroImage*, 180, 68-77.