Skip to content

Instantly share code, notes, and snippets.

View alexandrebarachant's full-sized avatar

alexandre barachant alexandrebarachant

View GitHub Profile
@alexandrebarachant
alexandrebarachant / confusion_and_prediction.py
Created May 19, 2020 16:20
confusion mat and predictions
from pybmi.modeling.loading.benchmarks import EventsBenchmarkLoader
from cogdata_service.service import simple_api
from workflow.experiments.utils import partition
from pybmi.modeling.events.metrics import events_confusion
import json
import matplotlib.pyplot as plt
def plot_preds(preds, time, alpha=1, ax=None, c='k', events=None):
if ax is None:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexandrebarachant
alexandrebarachant / pyRiemann_MI_template.py
Last active November 13, 2015 19:33
pyRiemann Motor imagery template
from pyriemann.estimation import Covariances
from pyriemann.tangentspace import TangentSpace
from sklearn.pipeline import make_pipeline
from sklearn.linear_model import LogisticRegression
from sklearn.cross_validation import cross_val_score
# load your data
X = ... # your EEG data, in format Ntrials x Nchannels X Nsamples
y = ... # the labels
@alexandrebarachant
alexandrebarachant / MNE_CSP.py
Created July 1, 2015 13:31
CSP for Grasp and lift challenge
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 29 14:00:37 2015
@author: alexandrebarachant
"""
import numpy as np
import pandas as pd
from mne.io import RawArray