Pca Dimensionality Reduction
aipoch/medical-research-skills
A skill your agent uses when performing PCA principal component dimensionality reduction on tabular numeric data.
Guides dimensionality reduction and latent-variable analysis of neural populations (PCA, GPFA, dPCA)
$ npx skills add NeuroAIHub/BrainPilot --skill neural-population-analysis-guide -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install NeuroAIHub/BrainPilot neural-population-analysis-guide --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/NeuroAIHub/BrainPilot.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide .claude/skills/neural-population-analysis-guide && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "neural-population-analysis-guide" agent skill from https://github.com/NeuroAIHub/BrainPilot/tree/main/packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide into .claude/skills/neural-population-analysis-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "neural-population-analysis-guide", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/NeuroAIHub/BrainPilot/tree/main/packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guideType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add NeuroAIHub/BrainPilot --skill neural-population-analysis-guide -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install NeuroAIHub/BrainPilot neural-population-analysis-guide --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/NeuroAIHub/BrainPilot.git skills-src && mkdir -p .agents/skills && cp -r skills-src/packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide .agents/skills/neural-population-analysis-guide && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "neural-population-analysis-guide" agent skill from https://github.com/NeuroAIHub/BrainPilot/tree/main/packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide into .agents/skills/neural-population-analysis-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "neural-population-analysis-guide", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add NeuroAIHub/BrainPilot --skill neural-population-analysis-guide -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install NeuroAIHub/BrainPilot neural-population-analysis-guide --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/NeuroAIHub/BrainPilot.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide .cursor/skills/neural-population-analysis-guide && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "neural-population-analysis-guide" agent skill from https://github.com/NeuroAIHub/BrainPilot/tree/main/packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide into .cursor/skills/neural-population-analysis-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "neural-population-analysis-guide", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/NeuroAIHub/BrainPilot.git --path packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add NeuroAIHub/BrainPilot --skill neural-population-analysis-guide -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install NeuroAIHub/BrainPilot neural-population-analysis-guide --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/NeuroAIHub/BrainPilot.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide .gemini/skills/neural-population-analysis-guide && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "neural-population-analysis-guide" agent skill from https://github.com/NeuroAIHub/BrainPilot/tree/main/packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide into .gemini/skills/neural-population-analysis-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "neural-population-analysis-guide", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install NeuroAIHub/BrainPilot neural-population-analysis-guideInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add NeuroAIHub/BrainPilot --skill neural-population-analysis-guide -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/NeuroAIHub/BrainPilot.git skills-src && mkdir -p .github/skills && cp -r skills-src/packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide .github/skills/neural-population-analysis-guide && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "neural-population-analysis-guide" agent skill from https://github.com/NeuroAIHub/BrainPilot/tree/main/packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide into .github/skills/neural-population-analysis-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "neural-population-analysis-guide", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add NeuroAIHub/BrainPilot --skill neural-population-analysis-guide -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install NeuroAIHub/BrainPilot neural-population-analysis-guide --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/NeuroAIHub/BrainPilot.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide .opencode/skills/neural-population-analysis-guide && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "neural-population-analysis-guide" agent skill from https://github.com/NeuroAIHub/BrainPilot/tree/main/packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide into .opencode/skills/neural-population-analysis-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "neural-population-analysis-guide", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
neural-population-analysis-guideGuides dimensionality reduction and latent-variable analysis of neural populations (PCA, GPFA, dPCA)
Neural Population Analysis Guide is an agent skill from NeuroAIHub/BrainPilot. Guides dimensionality reduction and latent-variable analysis of neural populations (PCA, GPFA, dPCA)
Its SKILL.md is about 4.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/data-requirements.md` and `references/method-comparison.md`).
The repository describes itself as: BrainPilot: Automating Brain Discovery with Agentic Research. The licence is AGPL-3.0.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 93f6855. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
github.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Neural Population Analysis Guide loads about 4.5k tokens when it runs, and up to ~7.6k if it reads all its reference files. Until then it costs about 33 tokens; SKILL.md has 2,060 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from NeuroAIHub/BrainPilot at commit 93f6855, republished under its AGPL-3.0 licence (© NeuroAIHub). 2,060 words, ~4,492 tokens.
.claude/skills/neural-population-analysis-guide/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.This skill encodes expert methodological knowledge for dimensionality reduction and latent-variable analysis of neural population recordings. A competent programmer without computational neuroscience training will get this wrong because:
Do NOT use this skill for:
neural-decoding-analysis skill instead)Before executing the domain-specific steps below, you MUST:
For detailed methodology guidance, see the research-literacy skill.
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.
Single-neuron analysis characterizes individual tuning curves and response properties. Population analysis characterizes the collective, low-dimensional structure of neural activity. Use population analysis when (Cunningham & Yu, 2014):
Domain judgment: Population analysis does NOT require that individual neurons be untuned. Even populations of well-tuned neurons have emergent low-dimensional structure that single-neuron analyses miss. The question is whether the research question is about individual neuron properties or collective population geometry (Cunningham & Yu, 2014).
What is your research question?
|
+-- "What are the dominant patterns of co-variation across the population?"
| --> PCA (linear, static)
| Simplest method; start here
| Output: principal components, variance explained, projections
|
+-- "What are the smooth latent trajectories on single trials?"
| --> GPFA (Yu et al., 2009) or Factor Analysis
| For temporal structure; extracts trial-by-trial dynamics
| Output: latent trajectories per trial, dimensionality estimate
|
+-- "How is variance distributed across task parameters?"
| --> dPCA (Kobak et al., 2016)
| Demixes stimulus, decision, time, and interaction variance
| Output: demixed components, marginalization pie chart
|
+-- "Are there rotational dynamics in the population?"
| --> jPCA (Churchland et al., 2012)
| Finds rotational structure in neural trajectories
| Output: rotational plane projections, R^2 of rotational fit
|
+-- "I want to visualize population structure in 2-3D"
--> t-SNE or UMAP -- VISUALIZATION ONLY
NOT for quantitative analysis or distance comparisons
Output: 2D/3D embedding (qualitative only)Trial averaging vs. single-trial: Trial-averaged PCA smooths out single-trial variability and is appropriate when the question is about condition-mean trajectories. Single-trial PCA preserves trial-to-trial variability but requires more data (Cunningham & Yu, 2014).
Soft normalization (CRITICAL): Do NOT use standard z-scoring (subtract mean, divide by SD). This eliminates firing rate differences that carry information. Instead, use soft normalization (Churchland et al., 2012):
normalized_rate = (rate - mean) / (range + constant) where constant is typically 5 spikes/s (Churchland et al., 2012). This prevents low-firing neurons from dominating due to noise amplification while preserving rate differences.
Square-root transform: An alternative normalization for Poisson-like spike counts: sqrt(mean firing rate + constant) (Churchland et al., 2012). Stabilizes variance across neurons with different firing rates.
Mean subtraction: Subtract the condition-averaged PSTH across all conditions from each condition. This removes the shared temporal modulation and focuses PCA on condition-discriminating variance (Kobak et al., 2016).
| Method | Description | When to Use | Source |
|---|---|---|---|
| Parallel analysis | Compare eigenvalues to those from shuffled data | Recommended default; principled threshold | Humphries, 2021 |
| Cross-validated PCA | Hold out neurons or time bins; test reconstruction | Avoids overfitting; gold standard | Cunningham & Yu, 2014 |
| Scree plot elbow | Subjective visual inspection | Quick but unreliable; avoid for publication | Expert consensus |
| Percent variance threshold | e.g., "keep PCs explaining 90%" | NOT recommended; arbitrary threshold | Humphries, 2021 |
Domain judgment: There is no fixed variance-explained threshold for choosing the number of PCs. The "90% rule" from data science is meaningless for neural data because it confounds signal dimensionality with noise. Use parallel analysis (compare eigenvalues to those expected from random data with matched statistics) or cross-validation (Humphries, 2021).
To avoid overfitting dimensionality estimates:
This is especially critical with small neuron counts (<50 neurons) where noise dimensions can mimic signal dimensions (Cunningham & Yu, 2014).
GPFA extracts smooth, low-dimensional latent trajectories from single-trial spike trains by combining factor analysis with Gaussian process temporal smoothing (Yu et al., 2009).
| Parameter | Recommended Value | Rationale | Source |
|---|---|---|---|
| Bin size | 20--50 ms | Smaller bins preserve temporal resolution but increase noise; 20 ms is standard for motor cortex | Yu et al., 2009 |
| Latent dimensions | Cross-validate | Fit models with 2--15 dimensions; select by leave-one-neuron-out cross-validation log-likelihood | Yu et al., 2009 |
| GP timescale (tau) | Learned from data | Each latent dimension has its own timescale; inspect for biologically plausible values (10--500 ms) | Yu et al., 2009 |
Domain judgment: GPFA is NOT simply "smoothed PCA." Factor analysis and PCA make different assumptions about noise structure. PCA treats all variance as signal; factor analysis separates shared (signal) variance from private (noise) variance per neuron. GPFA adds temporal smoothness to the shared component. This distinction matters when neurons have heterogeneous noise levels (Yu et al., 2009).
dPCA finds linear projections that capture maximum variance attributable to specific task parameters (e.g., stimulus identity, decision, time, and their interactions), rather than maximum total variance like PCA (Kobak et al., 2016).
Marginalization: Partition the data tensor by task parameter (e.g., average over all decisions to isolate stimulus variance). dPCA finds components that maximize variance within each marginalization (Kobak et al., 2016).
Regularization: The regularization parameter lambda controls the tradeoff between demixing (fidelity to marginalization) and reconstruction (total variance captured). Select lambda by cross-validation (Kobak et al., 2016):
| Classifier | When to Use | Source |
|---|---|---|
| Linear SVM | Default; robust for high-dimensional population data | Cunningham & Yu, 2014 |
| LDA | When number of neurons << number of trials | Cunningham & Yu, 2014 |
| Logistic Regression | When probability estimates are needed | Cunningham & Yu, 2014 |
| Strategy | When to Use | Source |
|---|---|---|
| Leave-one-trial-out | Small trial counts; maximizes training data | Cunningham & Yu, 2014 |
| Stratified k-fold (k=5--10) | Sufficient trials; balances bias/variance | Cunningham & Yu, 2014 |
Train a classifier at time t, test at all times t'. The resulting matrix reveals dynamics of neural coding (King & Dehaene, 2014):
See the neural-decoding-analysis skill for detailed guidance on temporal generalization.
Standard z-scoring (subtract mean, divide by SD) amplifies noise from low-firing neurons and eliminates informative rate differences. Always use soft normalization or square-root transform for neural population data (Churchland et al., 2012).
t-SNE and UMAP distort distances, create spurious clusters, and are sensitive to hyperparameters (perplexity, n_neighbors). They are useful for visualization but must NEVER be used for quantitative claims about distance, clustering, or dimensionality (Cunningham & Yu, 2014).
There is no universal threshold. The correct approach is parallel analysis (compare to null eigenvalue distribution) or cross-validated reconstruction (Humphries, 2021).
GPFA is designed for single-trial data. Applying it to trial-averaged PSTHs defeats its purpose (separating shared latent signal from private noise) and provides no advantage over PCA (Yu et al., 2009).
Population analyses have minimum neuron requirements for reliable estimates. Below ~30 simultaneously recorded neurons, dimensionality estimates from PCA are dominated by noise; GPFA latent trajectories become unstable below ~50 neurons (Cunningham & Yu, 2014; Yu et al., 2009).
Using default or arbitrary regularization parameters in dPCA can either over-demix (fitting noise) or under-demix (missing true task-related structure). Always cross-validate lambda (Kobak et al., 2016).
Based on Cunningham & Yu (2014), Kobak et al. (2016), and Yu et al. (2009):
See references/method-comparison.md for detailed parameter tables and software recommendations.
See references/data-requirements.md for minimum neuron and trial count guidelines by method.
© NeuroAIHub, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files (references) in packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide of NeuroAIHub/BrainPilot.
Open the folder on GitHubat commit 93f6855
Neural Population Analysis Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Neural Population Analysis Guide this skillNeuroAIHub/BrainPilot | 1.1k | — | ~4.5k | Automated safety check: Pass | AGPL-3.0 | |
| Pca Dimensionality Reductionaipoch/medical-research-skills | 1.9k | — | ~1.5k | Automated safety check: Pass | MIT | |
| Neural Trainingruvnet/ruflo | 74k | 1 repos | ~432 | Automated safety check: Pass | MIT | |
| Write Guidevercel/next.js | 143k | — | ~1.6k | Automated safety check: Pass | MIT | |
| Design Guidepaperclipai/paperclip | 100k | 1 repos | ~3.1k | Automated safety check: Pass | MIT | |
| Agent Neural Networkruvnet/ruflo | 74k | 2 repos | ~965 | Automated safety check: Pass | MIT |
aipoch/medical-research-skills
A skill your agent uses when performing PCA principal component dimensionality reduction on tabular numeric data.
ruvnet/ruflo
Neural pattern training with SONA (Self-Optimizing Neural Architecture), MoE (Mixture of Experts), and EWC++ for knowledge consolidation.
vercel/next.js
Generates technical guides that teach real-world use cases through progressive examples.
paperclipai/paperclip
Paperclip UI design system guide for building consistent, reusable frontend components.
ruvnet/ruflo
Agent skill for neural-network - invoke with $agent-neural-network
ruvnet/ruflo
Agent skill for safla-neural - invoke with $agent-safla-neural
NeuroAIHub/BrainPilot
Toolbox for markerless animal pose estimation with DeepLabCut.
NeuroAIHub/BrainPilot
Preprocess task-based or resting-state fMRI data with fMRIPrep — a robust, BIDS-App preprocessing pipeline built on FSL, ANTs, FreeSurfer, AFNI, and Nilearn.
NeuroAIHub/BrainPilot
Domain-validated pipeline guidance for EEG/MEG data analysis using MNE-Python: data loading, preprocessing (filtering, ICA, re-referencing), epoching, ERP/ERF computation, time-frequency…
NeuroAIHub/BrainPilot
Domain-validated guidance for network neuroscience analysis using netneurotools: datasets, brain network metrics, connectivity consensus, modularity, spatial statistics, null models, and cortical…
NeuroAIHub/BrainPilot
Submission-grade Nature/high-impact journal figure workflow for Python or R.
NeuroAIHub/BrainPilot
Domain-validated guidance for cortical surface visualization and brain surface rendering of fMRI data using pycortex: data types (Volume, Vertex, Dataset), 2D cortical flatmaps, 3D WebGL brain…
Guides dimensionality reduction and latent-variable analysis of neural populations (PCA, GPFA, dPCA). Neural Population Analysis Guide is an agent skill from NeuroAIHub/BrainPilot.
Run `npx skills add NeuroAIHub/BrainPilot --skill neural-population-analysis-guide -a claude-code`. Or copy the skill folder (packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide in NeuroAIHub/BrainPilot) into .claude/skills/neural-population-analysis-guide in your project. Claude Code loads it when a task matches its description.
Run `npx skills add NeuroAIHub/BrainPilot --skill neural-population-analysis-guide -a codex`. Or copy the skill folder (packages/skills/skills/08_Computational_Neuroscience/neural-population-analysis-guide in NeuroAIHub/BrainPilot) into .agents/skills/neural-population-analysis-guide in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add NeuroAIHub/BrainPilot --skill neural-population-analysis-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/neural-population-analysis-guide, .gemini/skills/neural-population-analysis-guide, .github/skills/neural-population-analysis-guide and .opencode/skills/neural-population-analysis-guide in your project.
SKILL.md names no scripts, command-line tools or credentials: Neural Population Analysis Guide is instructions for the agent only.
SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Neural Population Analysis Guide is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.5k tokens (SKILL.md is roughly 18k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.1k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Neural Population Analysis Guide: Pca Dimensionality Reduction (aipoch/medical-research-skills, 1.9k stars), Neural Training (ruvnet/ruflo, 74k stars), Write Guide (vercel/next.js, 143k stars) and Design Guide (paperclipai/paperclip, 100k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
NeuroAIHub (a GitHub organization) maintains it in NeuroAIHub/BrainPilot, which has 1,062 GitHub stars. The repository holds 59 skills in this directory. The repository was last updated on October 2, 2026.
Source: NeuroAIHub/BrainPilot on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.