Skip to main content

Implements Demixed Principal Components Analysis

Project description

dPCA is a linear dimensionality reduction technique that automatically discovers and highlights the essential features of complex population activities. The population activity is decomposed into a few demixed components that capture most of the variance in the data and that highlight the dynamic tuning of the population to various task parameters, such as stimuli, decisions, rewards, etc.

@article{kobak2016dpca,
   title={Demixed principal component analysis of neural population data},
   volume={5},
   ISSN={2050-084X},
   url={http://dx.doi.org/10.7554/eLife.10989},
   DOI={10.7554/elife.10989},
   journal={eLife},
   publisher={eLife Sciences Publications, Ltd},
   author={Kobak, Dmitry and Brendel, Wieland and Constantinidis, Christos and Feierstein, Claudia E and Kepecs, Adam and Mainen, Zachary F and Qi, Xue-Lian and Romo, Ranulfo and Uchida, Naoshige and Machens, Christian K},
   year={2016},
   month={Apr}
}

🚀 Quickstart

pip install dpca

🎉 Use dPCA

Simple example code for surrogate data can be found in [dpca_demo.ipynb](http://nbviewer.ipython.org/github/wielandbrendel/dPCA/blob/master/python/dPCA_demo.ipynb) and dpca_demo.m.

API of dPCA is similar to sklearn. To use dPCA, you should first import dPCA and initialize it before callling the fitting function,

from dpca import dPCA
dpca = dPCA(labels, n_components, regularizer)
Z = dpca.fit_transform(X)

The required initialization parameters are:

  • X: A multidimensional array containing the trial-averaged data. E.g. X[n,t,s,d] could correspond to the mean response of the n-th neuron at time t in trials with stimulus s and decision d. The observable (e.g. neuron index) needs to come first.

  • labels: Optional; list of characters with which to describe the parameter axes, e.g. ‘tsd’ to denote time, stimulus and decision axis. All marginalizations (e.g. time-stimulus) are refered to by subsets of those characters (e.g. ‘ts’).

  • n_components: Dictionary or integer; if integer use the same number of components in each marginalization, otherwise every (key,value) pair refers to the number of components (value) in a marginalization (key).

More detailed documentation, and additional options, can be found in dpca.py.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dPCA-1.0.5.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

dPCA-1.0.5-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file dPCA-1.0.5.tar.gz.

File metadata

  • Download URL: dPCA-1.0.5.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5

File hashes

Hashes for dPCA-1.0.5.tar.gz
Algorithm Hash digest
SHA256 1c83c560678127b85a7a816a0d56b5c5064da48b951d27339d5b2d1ad5d65a28
MD5 fadc40db13e1afcd8740c12ba1fe1e3f
BLAKE2b-256 bb182db57a9cb9c7b811d2c442a89ab0a7f62ae46fc8da0783a434e4346f91f8

See more details on using hashes here.

File details

Details for the file dPCA-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: dPCA-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5

File hashes

Hashes for dPCA-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 73b0765aedbfe367fab28b20c9902c567ba8ac96c35d76ee576de655786ede18
MD5 af390c1ca99c5b64a3c4fddca8f20f0b
BLAKE2b-256 f26eece2f7bfaa3e0041b57482c32367d76e63a5ea4585779e5c8acadf481f14

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page