Skip to main content

A Python Toolbox for Cross-Temporal Representational Similarity Analysis-based Decoding on E/MEG Data

Project description

# PyCTRSA

[![PyPI version](https://img.shields.io/pypi/v/pyctrsa?style=flat-square)](https://pypi.org/project/pyctrsa/) [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

#### A Python toolbox for Cross-Temporal Representation Similarity Analysis (RSA)-based Decoding on EEG/MEG data

## Download > pip install pyctrsa

## Required Dependencies

  • [Numpy](https://www.numpy.org): a fundamental package for scientific computing.

  • [SciPy](https://www.scipy.org/scipylib/index.html): a package that provides many user-friendly and efficient numerical routines.

  • [Matplotlib](https://matplotlib.org): a Python 2D plotting library.

  • [NeuroRA](https://zitonglu1996.github.io/NeuroRA/): a Python toolbox for multimode neural data Representation Analysis.

## Hightlight In traditional RSA, we can only use a coding model RDM to fit the RDMs from neural data time by time. So, can we do cross-temporal decoding based on RSA?

CTRSA-based decoding is a new algorithm for cross-temporal E/MEG decoding by RSA. We use the neural data from two different time-points to establish a Cross-Temporal Representatonal Dissimilarity Matrix (RDM) corrsponding to time i and time j. By this train of thought, we can obtain Number_of_Times by Number_of_Times Cross-Temporal RDMs. Then we can establish a Coding Model RDM by the experimental hypothesis. Finally, we can calculate the similarity between this Coding Model RDM and the Number_of_Times by Number_of_Times Cross-Temporal RDMs and obtain the cross-temporal decoding results.

## Notes In PyCTRSA, you can not only calculate the cross-temporal similarities based on this novel methods to realize decoding, but also calculate the cross-temporal similarities based on neural data under two different conditions to see the similar data patterns between two conditions and calculate the cross-temporal similarities based on normal RDMs to see the similar representational patterns between different time-points.

## Features

1. Calculate the Cross-Temporal RDM (Novel here!)

> calculate CTRDMs for a single channel/subject > calculate CTRDMs for multi-channels&subejcts

2. Calculate the similarity between two CTRDMs (Novel here!)

> by Pearson Correlation/Spearman Correlation/Kendall tau Correlation/Cosine Similarity/Euclidean Distance

3. Calculate the Cross-Temporal Similarities

> calculate CTSimilarities between neural data under two conditions > calculate CTSimilarities based on normal RDMs > calculate CTSimilarities between CTRDMs and a Coding Model RDM (Novel here!)

4. Plot the Results

> plot the CTRDM > plot the CTSimilarities > plot the time-by-time similarities

## How to use PyCTRSA

## Efficiency of using PyCTRSA

Here, we use a tutorial to compare the traditional classification-based decoding and novel cross-temporal RSA-based decoding below:

## About PyCTRSA

This work should be affilliated with [NeuroRA](https:/zitonglu1996.github.io/NeuroRA/), but it is an independent part.

If you have any question, find some bugs or have some useful suggestions while using, you can email me and I will be happy and thankful to know.

>My email address: >zitonglu1996@gmail.com / zitonglu@outlook.com

>My personal homepage: >https://zitonglu1996.github.io

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

pyctrsa-0.1.0.tar.gz (13.5 kB view hashes)

Uploaded Source

Built Distribution

pyctrsa-0.1.0-py3-none-any.whl (24.2 kB view hashes)

Uploaded Python 3

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