This file contains 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 scipy import stats | |
class GaussianKernelDensityEstimation(object): | |
"""docstring for GaussianKernelDensityEstimation""" | |
def __init__(self): | |
self.gkde = None | |
def fit(self, X): | |
"""docstring for fit""" | |
self.gkde = stats.gaussian_kde(X.T) |
This file contains 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
""" | |
========================== | |
Feature Selection Shootout | |
========================== | |
Illustration of feature selection with : | |
- RFE-SVC | |
- Anova-SVC | |
- L1-Logistic Regression | |
""" |
This file contains 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
""" | |
Author: Oliver Mitevski | |
References: | |
A Generalized Linear Model for Principal Component Analysis of Binary Data, | |
Andrew I. Schein; Lawrence K. Saul; Lyle H. Ungar | |
The code was translated and adapted from Jakob Verbeek's | |
"Hidden Markov models and mixtures for Binary PCA" implementation in MATLAB |
This file contains 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
""" | |
This module implements the Lowess function for nonparametric regression. | |
Functions: | |
lowess Fit a smooth nonparametric regression curve to a scatterplot. | |
For more information, see | |
William S. Cleveland: "Robust locally weighted regression and smoothing | |
scatterplots", Journal of the American Statistical Association, December 1979, |
This file contains 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
"""A module which implements the continuous wavelet transform | |
with complex Morlet wavelets. | |
Author : Alexandre Gramfort, gramfort@nmr.mgh.harvard.edu (2011) | |
License : BSD 3-clause | |
inspired by Matlab code from Sheraz Khan & Brainstorm & SPM | |
""" | |
from math import sqrt |
This file contains 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 pprint import pprint | |
import numpy as np | |
from scipy import sparse | |
from scikits.learn.grid_search import GridSearchCV | |
from scikits.learn.cross_val import StratifiedKFold | |
from scikits.learn.metrics import f1_score, classification_report | |
from scikits.learn import svm | |
from scikits.learn.linear_model import LogisticRegression | |
from scikits.learn.linear_model.sparse import LogisticRegression as SparseLogisticRegression |
This file contains 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
"""Testing the difference between two coefficients of correlation | |
Following: | |
Thöni, H. (1977), Testing the Difference Between two Coefficients of Correlation. | |
Biometrical Journal, 19: 355–359. doi: 10.1002/bimj.4710190506 | |
http://onlinelibrary.wiley.com/doi/10.1002/bimj.4710190506/abstract | |
""" | |
from math import log, sqrt |
This file contains 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
#!/usr/bin/env python | |
""" | |
Simple viewer for tri mesh files and OpenMEEG geometry files | |
Usage | |
----- | |
om_viz.py model.geom mesh1.tri mesh2.tri dipoles.txt |
This file contains 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 scipy import linalg | |
from sklearn import datasets, svm, linear_model | |
from sklearn.svm import l1_min_c | |
iris = datasets.load_iris() | |
X = iris.data | |
y = iris.target |
This file contains 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
Dendogram = namedtuple('Dendogram', ['children', 'n_leaves', 'n_components']) | |
def hierarchical_tree(X, linkage_criterion='ward', connectivity=None, n_components=None, copy=True): | |
... | |
for ...: | |
if linkage_criterion == 'ward': |
OlderNewer