Skip to content

Vectorise the population decoder in numpy - #218

Merged
celefthe merged 5 commits into
mainfrom
celefthe/issue204
Oct 12, 2026
Merged

celefthe merged 5 commits into
mainfrom
celefthe/issue204

Conversation

@celefthe

Copy link
Copy Markdown
Member

Closes #204.

process decode fits the population logistic regression and linear discriminant in numpy across windows, folds and shuffles at once, as it already did for the one-feature decoders, instead of one scikit-learn fit per fold.

  • decoding.population_decisions, with population_lda_decisions (scikit-learn's lsqr solver with Ledoit-Wolf shrinkage) and population_logistic_decisions (batched Newton steps with backtracking).
  • region_decisions fits the one-feature logistic regressions through population_decisions, and logistic_decisions is removed.
  • decoding_table and rolling_table take the population scores, nulls and weights from population_decisions. fit_scores stays as the scikit-learn reference in the tests.
  • Population logistic scores and weights change slightly, since the Newton fits converge further than scikit-learn's default tolerance.
  • Tests in tests/test_process.py, docs/how-to/decoding.md and a changelog entry.

@celefthe
celefthe merged commit c719d17 into main Oct 12, 2026
8 checks passed
@celefthe
celefthe deleted the celefthe/issue204 branch October 12, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vectorise the population decoder in numpy

1 participant