Code Monkey home page Code Monkey logo

dspca's Introduction

Demixed Subspace Principal Component Analysis (dsPCA)

dsPCA is a dimensionality reduction algorithm for high-dimensional data such as neural population activity. dsPCA describes high-dimensional data by finding best demixed linear coding axes for targeted variables and finding linear dimensions that concicely describe the remaining variance in the data. The demixed coding axes for targeted variables are identified with a supervised approach, and then the axes that capture the remaining variance in the data are identified with an unsupervised approach. Importantly, dsPCA completely removes the linear coding of target signals from data before the unsupervised axis identifications. Therefore, dsPCA decomposes a high-dimensional data into a subspace that fully captures all target signals in the data and a subspace that is free of all target signals.

Installation

I will eventually make it available from PyPl. For now, please download all files from this github repository and locally pip install.

How to use

dsPCA code is written for Python 3.x
Please check an example demo in dsPCA_demo.ipynb for the basic implementation.

After installation, import dsPCA

from dspca import dsPCA

Provide data ([# of observations] X [# of dimensions to be reduced]) and targets ([# of observations] X [# of targets])

dsPCA(data=data, targets=targets)

The outputs of the function are in the order of

projection_target_subspace
projection_targetfree_subspace
ax_targets, ax_targetfree
target_subspace_signal
targetfree_subspace_signal
target_subspace_var
targetfree_subspace_var
total_var
dot_target_ax

projection_target_subspace

  • Projection of data onto demixed target signal axes.

projection_targetfree_subspace

  • Projection of population activity to the axes of target-free subspace.

ax_targets

  • Axis vectors for the target signal subspace.

ax_targetfree

  • Axis vectors for the target-free signal subspace.

target_subspace_signal

  • Pearson correlation coefficient between the projected data along each target axis and the targeted task-related variables.

targetfree_subspace_signal

  • Pearson correlation coefficient between the projected data along each target-free axis and the targeted task-related variables.

target_subspace_var

  • Data variance along each taraget axis.

targetfree_subspace_var

  • Data variance along each taraget-free axis.

total_var

  • Total data variance of the original input data.

dot_target_ax

  • Matrix with dot products between pairs of target axis vectors.

dspca's People

Contributors

ryhattori avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.