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 | |
os.environ["OMP_NUM_THREADS"] = "1" | |
from time import perf_counter | |
from sklearn.utils import check_random_state | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy import sparse | |
d = 1000 |
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 time | |
import numpy as np | |
from numba import njit | |
from numpy.linalg import norm | |
from scipy.sparse.linalg import norm as snorm | |
from libsvmdata import fetch_libsvm | |
X, y = fetch_libsvm("finance") | |
@njit |
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") |
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
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
"""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 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
\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
# 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
from pyface.qt import QtGui, QtCore | |
%matplotlib qt |
NewerOlder