Skip to content

Instantly share code, notes, and snippets.

View GaelVaroquaux's full-sized avatar

Gael Varoquaux GaelVaroquaux

View GitHub Profile
@GaelVaroquaux
GaelVaroquaux / sklearn_EN_example.py
Created September 29, 2012 16:16 — forked from arokem/sklearn_EN_example.py
Demonstrate that ElasticNet doesn't fit all the way, even for rather strict convergence criteria
import numpy as np
import sklearn.linear_model as lm
X = np.array([[ -2.18252949e-01, -8.21949578e-02, -4.64055457e-02,
-1.78405908e-01, -1.93863740e-01, 5.30667625e-02,
1.83851107e-01, 1.23426449e-01, 1.97396315e-01,
-2.12615837e-01, 7.06452283e-02, -1.94509405e-01,
-9.77929516e-02, 2.07135018e-01, -3.40368338e-02,
2.02970673e-01, -2.28669466e-01, 4.17398420e-02,
1.80163132e-01, 3.24254938e-02, -2.41198452e-03,
@GaelVaroquaux
GaelVaroquaux / lasso.py
Created October 5, 2012 07:12 — forked from aweinstein/lasso.py
scikitlearn lasso path fat vs thin X matrix
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import Lasso, lars_path
np.random.seed(42)
def gen_data(n, m, k):
X = np.random.randn(n, m)
w = np.zeros((m, 1))
i = np.arange(0, m)
@GaelVaroquaux
GaelVaroquaux / strategies_comparison.py
Last active May 17, 2016 20:22 — forked from aabadie/strategies_comparison.py
Persistence strategies comparison
"""Persistence strategies comparison script.
This script compute the speed, memory used and disk space used when dumping and
loading arbitrary data. The data are taken among:
- scikit-learn Labeled Faces in the Wild dataset (LFW)
- a fully random numpy array with 10000x10000 shape
- a dictionary with 1M random keys/values
- a list containing 10M random value
The compared persistence strategies are: