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 os.path import join as pjoin | |
import numpy as np | |
from numpy.linalg import norm | |
import time | |
import mne | |
from mne.datasets import sample | |
from mne.inverse_sparse.mxne_inverse import (_to_fixed_ori, _prepare_gain) | |
from mne.inverse_sparse.mxne_optim import mixed_norm_solver, norm_l2inf, norm_l21 | |
# from mne.inverse_sparse.mxne_optim import _mixed_norm_solver_cd |
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 os | |
import mne | |
from mne.datasets import somato | |
data_path = somato.data_path() | |
raw_fname = data_path + '/MEG/somato/sef_raw_sss.fif' | |
trans = data_path + '/MEG/somato/sef_raw_sss-trans.fif' | |
src = data_path + '/subjects/somato/bem/somato-oct-6-src.fif' | |
bem = data_path + '/subjects/somato/bem/somato-5120-bem-sol.fif' |
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 pyface.qt import QtGui, QtCore | |
%matplotlib qt |
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
# obtained with priceless help from Olivier Grisel | |
# rpy2 is available via pip: pip install rpy2 | |
import numpy as np | |
from rpy2 import robjects | |
import rpy2.robjects.packages as rpackages | |
from rpy2.robjects import numpy2ri | |
from rpy2.robjects import pandas2ri | |
# we use function ltsReg of package robustbase | |
if __name__ == "__main__": |
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
\begin{wrapfigure}{h!}{0.42\textwidth} | |
\centering | |
\includegraphics[width=0.42\textwidth]{prebuiltimages/KL_Ball.pdf}\\ | |
\caption{\label{plot:q_set_example}Example of sets $\Qset_{\alpha}(\Prob_{Z})$ and $\Qset_{\alpha}(\Prob_{Z})$ with $\balpha < \alpha$.} | |
\end{wrapfigure} |
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 matplotlib.pyplot as plt | |
from matplotlib import rc | |
import seaborn as sns | |
rc('font', **{'family': 'sans-serif', | |
'sans-serif': ['Computer Modern Roman']}) | |
params = {'axes.labelsize': 12, | |
'font.size': 12, | |
'legend.fontsize': 12, | |
'xtick.labelsize': 10, |
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
"""l-bfgs-b L1-Logistic Regression solver""" | |
# Author: Vlad Niculae <vlad@vene.ro> | |
# Suggested by Mathieu Blondel | |
from __future__ import division, print_function | |
import numpy as np | |
from scipy.optimize import fmin_l_bfgs_b |
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 numba import njit | |
import matplotlib.pyplot as plt | |
from scipy.linalg import toeplitz | |
from numpy.linalg import norm | |
from sklearn.utils import check_random_state | |
from sklearn.linear_model import LinearRegression | |
def data(n_samples, n_features, rho=0.5, seed=24): |
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 numba import njit | |
from numpy.linalg import norm | |
import matplotlib.pyplot as plt | |
from sklearn.linear_model import LinearRegression | |
from libsvmdata import fetch_libsvm | |
# from celer.datasets import make_correlated_data | |
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 celer import Lasso | |
import matplotlib.pyplot as plt | |
from scipy.optimize import fmin_bfgs | |
from numpy.linalg import norm | |
import numpy as np | |
from celer.datasets import make_correlated_data | |
import seaborn as sns | |
c_list = sns.color_palette("colorblind") |
OlderNewer