Skip to main content

Unlocking subject-independent motor imagery decoding with label alignment.

Project description

LATSS

A subject-independent motor imagery classification model.

Description

Label Alignment - Tangent Space Mapping - SVM, or LATSS for short, is a subject-independent motor imagery classification model that utilizes advanced domain adaptation techniques to improve the generalization of the model across subjects.

Installation

$ pip install latss

Usage

Training and predicting with the LATSS model is simple. Here's an example of how to use it:

from latss import LATSS

# Load source data
source_data = ...

# Initialize the model
model = LATSS(source_data=source_data)

# Calibrate and train the model
# Note: calibration_data must be an annotated mne.io.Raw object
calibration_data = ...
event_id = {
            'left_hand': 1,
            'right_hand': 2,
            }
acc = model.calibrate(calibration_data, event_id=event_id)

# Predict on new data
# Note: new_data must be a mne.io.Raw object as well
new_data = ...
prediction = model.predict(new_data)

Source data can be any mne.Epochs object or a dictionary with the following structure:

{
    'data': np.array,  # shape: (n_trials, n_channels, n_samples)
    'labels': np.array,  # shape: (n_events, 3)
}

License

latss was created by Zeyad Ahmed. It is licensed under the terms of the MIT license.

Credits

The LATSS model was inspired by the work of He et al. [1], while introducing some key modifications and improvements.

[1] H. He and D. Wu, "Different Set Domain Adaptation for Brain-Computer Interfaces: A Label Alignment Approach," in IEEE Transactions on Neural Systems and Rehabilitation Engineering, vol. 28, no. 5, pp. 1091-1108, May 2020, doi: 10.1109/TNSRE.2020.2980299.

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

latss-0.1.2.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

latss-0.1.2-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file latss-0.1.2.tar.gz.

File metadata

  • Download URL: latss-0.1.2.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for latss-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9224e66e9bd9c11e71d69c4ee0aa64c1723c950600d933acacf7d7a948eaab74
MD5 afa86274f6fa2900e591cb93089686db
BLAKE2b-256 03500d1e432e3d5cf93eb2f9355efab6a3f82f378f719cef412225632b73159f

See more details on using hashes here.

File details

Details for the file latss-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: latss-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for latss-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 176087d03433b395903381f08f2c9b13d96ce2bc7a09b27c308bdb63f2e9a580
MD5 3e90f27a89aa728900fe7eddf94aa0f8
BLAKE2b-256 4f22a986017e38224c4e6698e36035f500d4fdd0c4d9153f96e12bf8d850f69e

See more details on using hashes here.

Supported by

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