Decodanda: a Python toolbox for best-practice decoding and geometric analysis of neural representations
Posani, L.
Show abstract
Neural decoding is a powerful approach for inferring which variables are represented in the activity of a population of neurons, with broad applications ranging from basic neuroscience to clinical settings such as brain-computer interfaces. More recently, decoding has also been used as a cross-validated tool for studying the computationally relevant properties of representational geometry, revealing not only whether a variable is encoded, but also how it is encoded and which computations the collective activity of neural populations may support. However, decoding analyses present several technical challenges and common pitfalls that can lead to misleading conclusions if not handled carefully. Here, we introduce Decodanda, a Python toolbox for decoding and geometric analysis of neural population activity. Decodanda provides functions for decoding arbitrary variables and for quantifying geometric features of neural representations, including shattering dimensionality and cross-condition generalization performance (CCGP). Importantly, the package automates several essential best-practice safeguards, including trial-based cross-validation to avoid training-testing leakage from temporally correlated neural traces (a particularly important issue for calcium imaging data), null models for statistical significance, pseudo-population pooling, and cross-variable balancing to determine which of a set of correlated variables is genuinely encoded in the activity. Decodanda is agnostic to the specific classifier used for decoding, and it is designed to be both user-friendly and highly customizable, allowing researchers to assemble flexible analysis pipelines from modular building blocks. Here, we provide an overview of the design principles of Decodanda and illustrate its use cases in neuroscience research. Documentation, example notebooks, and source code are available at github.com/lposani/decodanda.
Matching journals
The top 7 journals account for 50% of the predicted probability mass.