Skip to content

Instantly share code, notes, and snippets.

View dengemann's full-sized avatar

Denis A. Engemann dengemann

View GitHub Profile
# License: BSD (3-clause)
# Author: Denis A. Engemann <[email protected]>
# Based on :
import platform
import psutil
import datetime
from time import time
import os
# License: BSD (3-clause)
# Author: Denis A. Engemann <[email protected]>
# Based on :
# https://gist.github.com/markus-beuckelmann/8bc25531b11158431a5b09a45abd6276
import platform
import psutil
import datetime
from time import time
# License: BSD (3-clause)
# Author: Denis A. Engemann <[email protected]>
library(ggplot2)
library(tidymodels)
library(readr)
library(wesanderson)
hotels <-
read_csv('https://tidymodels.org/start/case-study/hotels.csv') %>%
# License: BSD (3-clause)
# Author: Denis A. Engemann <[email protected]>
library(tidymodels)
library(readr)
library(microbenchmark)
hotels <-
read_csv('https://tidymodels.org/start/case-study/hotels.csv') %>%
mutate_if(is.character, as.factor)
# Authors: Denis A. Engemann <[email protected]>
#
# License: BSD (3-clause)
from copy import deepcopy
import numpy as np
import matplotlib.pyplot as plt
import mne
data_path = mne.datasets.somato.data_path()
aws ec2 create-security-group --group-name "IPython" --description "Allow traffic for IPython notebooks" --vpc-id {my-region-vpc} --region {my-region}
{
"GroupId": "{my-security-group}"
}
aws ec2 authorize-security-group-ingress --group-id {my-security-group} --protocol tcp --port 22 --cidr 0.0.0.0/0 --region {my-region}
aws ec2 authorize-security-group-ingress --group-id {my-security-group} --protocol tcp --port 443 --cidr 0.0.0.0/0 --region {my-region}
aws ec2 authorize-security-group-ingress --group-id {my-security-group} --protocol tcp --port 8888 --cidr 0.0.0.0/0 --region {my-region}
#!/usr/bin/bash
subjects=(100307 102816 104012 105923 106521 108323 109123 111514 112920 113922 116524 116726 133019 140117 146129 149741 153732 154532 156334 158136 162026 162935 164636 166438 169040 172029 174841 175237 175540 177746 179245 181232 185442 187547 189349 191033 191437 191841 192641 195041 198653 204521 205119 212318 212823 214524 221319 223929 233326 248339 250427 255639 257845 283543 287248 293748 352132 352738 353740 358144 406836 433839 512835 555348 559053 568963 581450 599671 601127 660951 662551 665254 667056 679770 680957 706040 707749 715950 725751 735148 783462 814649 825048 872764 877168 891667 898176 912447 917255 990366)
for sub in $subjects; do s3cmd ls s3://hcp-openaccess/HCP_900/$sub/T1w/$sub/label; done | wc -l
# 66
for sub in $subjects; do s3cmd ls s3://hcp-openaccess/HCP_900/$sub/T1w/$sub/surf; done | wc -l
# 66
for sub in $subjects; do s3cmd ls s3://hcp-openaccess/HCP_900/$sub/T1w/$sub/mri; done | wc -l
# 66
for sub in $subjects; do s3cmd ls s3://hcp-openaccess/HCP_900/$sub
import numpy as np
from scipy import linalg
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.connectivity import spectral_connectivity
from mne.datasets import sample
from swish.surrogates import theilerize_raw
from mne.minimum_norm import (apply_inverse, apply_inverse_epochs,
# Authors: Denis A. Engemann <[email protected]>
#
# License: BSD (3-clause)
import os
import os.path as op
import shlex
from subprocess import call
import numpy as np
import matplotlib.pyplot as plt
"""
========================================
Regression on continuous data (rER[P/F])
========================================
This demonstrates how rERPs/regressing the continuous data is a
generalisation of traditional averaging. If all preprocessing steps
are the same and if no overlap between epochs exists and if all
predictors are binary, regression is virtually identical to traditional
averaging.