{"id":15716371,"url":"https://github.com/machenslab/dpca","last_synced_at":"2025-04-04T18:05:24.622Z","repository":{"id":19503186,"uuid":"22749656","full_name":"machenslab/dPCA","owner":"machenslab","description":"An implementation of demixed Principal Component Analysis (a supervised linear dimensionality reduction technique)","archived":false,"fork":false,"pushed_at":"2022-06-02T10:02:01.000Z","size":1586,"stargazers_count":278,"open_issues_count":9,"forks_count":94,"subscribers_count":26,"default_branch":"master","last_synced_at":"2024-10-25T04:24:45.011Z","etag":null,"topics":["dimensionality-reduction","matlab","python"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/machenslab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-08T07:30:00.000Z","updated_at":"2024-10-11T22:35:11.000Z","dependencies_parsed_at":"2022-08-30T03:11:46.339Z","dependency_job_id":null,"html_url":"https://github.com/machenslab/dPCA","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machenslab%2FdPCA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machenslab%2FdPCA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machenslab%2FdPCA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machenslab%2FdPCA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/machenslab","download_url":"https://codeload.github.com/machenslab/dPCA/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226213,"owners_count":20904465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dimensionality-reduction","matlab","python"],"created_at":"2024-10-03T21:45:16.286Z","updated_at":"2025-04-04T18:05:24.604Z","avatar_url":"https://github.com/machenslab.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"demixed Principal Component Analysis (dPCA)\n===========================================\n\ndPCA 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.\n\n\u003e D Kobak\u003csup\u003e+\u003c/sup\u003e, W Brendel\u003csup\u003e+\u003c/sup\u003e, C Constantinidis, CE Feierstein,\nA Kepecs, ZF Mainen, X-L Qi, R Romo, N Uchida, CK Machens\u003cbr\u003e\n\u003e **Demixed principal component analysis of neural population data**\u003cbr\u003e\n\u003e eLife 2016, https://elifesciences.org/content/5/e10989\u003cbr\u003e\n\u003e (arXiv link: http://arxiv.org/abs/1410.6031)\n\nThis repository provides easy to use Python and MATLAB implementations of dPCA as well as example code.\n\n## Use dPCA\n\nSimple 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**.\n\n### Python package\n\nThe Python package is tested against Python 2.7 and Python 3.4. To install, first make sure that numpy, cython, scipy, sklearn, itertools and numexpr are avaible. Then copy the files from the Python subfolder to a location in the Python search path.\n\nAlternatively, from the terminal you can install the package by running:\n\n```\n$  cd /path/to/dPCA/python\n$  python setup.py install\n```\n\nAPI of dPCA is similar to sklearn. To use dPCA, you should first import dPCA,  \n`from dpca import dPCA`  \nthen initialize it,    \n`dpca = dPCA(labels, n_components, regularizer)`    \nthen call the fitting function on your data to get the latent components Z,    \n`Z = dpca.fit_transform(X)`.\n\nThe required initialization parameters are:\n- *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.\n- *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- *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).\n\nMore detailed documentation, and additional options, can be found in **dpca.py**.\n\n### MATLAB package\n\nAdd the Matlab subfolder to the Matlab search path.\n\nExample code in `dpca_demo.m` generates surrogate data and provides a walkthrough for running PCA and dPCA analysis and  plotting the results.\n\n### Support\n\nEmail wieland.brendel@bethgelab.org (Python) or dmitry.kobak@neuro.fchampalimaud.org (Matlab) with any questions.\n\n### Contributors\n\nA big thanks for 3rd party contributions goes to **cboulay**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachenslab%2Fdpca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmachenslab%2Fdpca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachenslab%2Fdpca/lists"}