Skip to main content

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'

Metadata

Release files for temp-dec 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for temp-dec 1.0
File Size Uploaded Provenance
temp_dec-1.0.tar.gz 3.4 kB Without provenance Details

Release files / temp_dec-1.0.tar.gz

Download URL temp_dec-1.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
32eece25b2a2a7006a303b4133c67a055531efb886be9a59a9f6d015915f522e
BLAKE2b-256 checksum
How to use checksums
2bdfbb3657b2a221e537d853e5e66e21c1c9843032ced03f97bd535812b00dcc
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for temp-dec 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page