Skip to content

Instantly share code, notes, and snippets.

@MechCoder
Created May 26, 2014 08:21
Show Gist options
  • Save MechCoder/8b244d22b5a3b031e96e to your computer and use it in GitHub Desktop.
Save MechCoder/8b244d22b5a3b031e96e to your computer and use it in GitHub Desktop.
from sklearn.linear_model import ElasticNetCV
from sklearn.datasets import make_regression
import numpy as np
from scipy.sparse import csr_matrix
X, y = make_regression(n_samples=2000, n_features=2000)
clf = ElasticNetCV(n_jobs=4, cv=3, n_alphas=100, fit_intercept=False, l1_ratio=np.linspace(0.1, 0.9, 5))
clf.fit(X, y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment