Skip to content

Instantly share code, notes, and snippets.

@ibayer
ibayer / strong_rule_enet.py
Created July 27, 2012 13:50 — forked from agramfort/gist:3181189
strong rules lasso and enet
# -*- coding: utf-8 -*-
"""
Generalized linear models via coordinate descent
Author: Fabian Pedregosa <[email protected]>
"""
import numpy as np
from scipy import linalg
@ibayer
ibayer / cd_fast2.py
Created June 24, 2012 19:17 — forked from agramfort/cd_fast2.py
test pure glmnet cd python implementation against cd_fast.enet_coordinate_descent
import numpy as np
from cd_regression import enet_f
def fsign(f):
if f == 0:
return 0
elif f > 0:
return 1.0
else: