This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
============================================================= | |
Compute PDC spectrum source space connectivity between labels | |
============================================================= | |
The connectivity is computed between 4 labels across the spectrum | |
between 5 and 40 Hz. | |
""" | |
# Authors: Alexandre Gramfort <[email protected]> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from numpy.polynomial.legendre import legval | |
from numpy.linalg import solve | |
def calc_spline(cosang, stiffnes=4, num_lterms=50): | |
"""Calculate spherical spline between points on a sphere. | |
Parameters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from sklearn.lda import LDA | |
from sklearn.datasets import make_blobs | |
from sklearn.utils import check_array | |
from sklearn.svm import LinearSVC | |
import matplotlib.pyplot as plt | |
def new_transform(lda, X): | |
X = check_array(X) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Released under The MIT License (MIT) | |
# http://opensource.org/licenses/MIT | |
# Copyright (c) 2015 Martin Billinger | |
import numpy as np | |
import scipy as sp | |
import matplotlib | |
from matplotlib.colors import LinearSegmentedColormap | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from sklearn.decomposition import FastICA, PCA | |
from sklearn.cluster import AffinityPropagation | |
import matplotlib.pyplot as plt | |
from scot.eegtopo.topoplot import Topoplot | |
from scot.external.infomax_ import infomax | |
from scot.csp import csp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import seaborn | |
from scot.var import VAR | |
from scot.connectivity import connectivity | |
fs = 100 | |
n = 10001 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" pyrx | |
Implementation of a minimal Forth interpreter/compiler on top of Python 3.6. | |
It is based on Rx [1] and should eventually support Retro [2]. | |
Facts & Features: | |
- New words are compiled to Python bytecode (subroutine threading model). | |
- Dynamically typed: the only data type is the Python object. | |
- Literals are evaluated as Python expressions. | |
- The data stack is a global Python list. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import scipy.stats as sps | |
def median_ci(x, alpha=0.95, method='approximate'): | |
"""confidence interval of the median""" | |
n = len(x) | |
y = np.sort(x) | |
if method[0] == 'a': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ctypes import CFUNCTYPE, c_double, c_int32, c_voidp, c_char | |
import llvmlite.binding as llvm | |
from llvmlite import ir | |
# Looping does not yet work... looks like I'll need to grok the phi instruction.... | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Python module for conveniently comparing the performance of | |
different Python statements. | |
Features: | |
- wraps `timeit` | |
- one function call to compare multiple statements | |
- textual and graphical representation of results | |
""" | |
import numpy as np |
OlderNewer