Skip to main content

Supervised learning simple function for temporal decoding.

Project description

Supervised Learning Toolbox for Neural data

This toolbox facilitates neural decoding of time series. Under the hood it uses scikit-learn functions.

Set-up

Install using pip

pip install temp_dec

Requirements

sklearn==0.21.3
numpy==1.13.1
scipy==0.19.1

Example

This function takes in the data X (ndarray; trials by channels by time), labels y (ndarray; vector), and a time (ndarray, vector).

from temp_dec import decoding_functions

Using a sliding time window

If there is information in the temporal dynamics of the signal, using a sliding time window will increase decoding accuracy (and smooth the signal). We also demean the signal within each window, this avoids the issue of baselining.

temporal_dymanics == True

Applying PCA

If you use a large amount of features, you might want to consider applying PCA to your features before applying your classifier. In addition, classifiers are sensitive to noise rejecting noise components from the data can be beneficial.

use_pca == True

You can also regulate how many components you would like to keep (setting the pca_components variant to > 1) or how much variance you would like to explain (setting the pca_components variant to < 1). As a general rule of thumb maintaining 95% of variance will maintain enough signal and reduces feature space.

pca_components == .95

Classifiers

Different classifiers are supported, selected in accordance with Grootwagers et al (2017) j.cogn.neurosci.

  • LDA: linear disciminant analysis
  • LG: logistic regression
  • GNB: Gaussian Naive Bayes
  • maha: Nearest Neighbours using mahalanobis distance.
classifier == 'LDA'

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

temp_dec-1.0.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file temp_dec-1.0.tar.gz.

File metadata

  • Download URL: temp_dec-1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for temp_dec-1.0.tar.gz
Algorithm Hash digest
SHA256 32eece25b2a2a7006a303b4133c67a055531efb886be9a59a9f6d015915f522e
MD5 f75891a46a3adcab574a346410ad0b07
BLAKE2b-256 2bdfbb3657b2a221e537d853e5e66e21c1c9843032ced03f97bd535812b00dcc

See more details on using hashes here.

Supported by

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