Contents

scikits.learn.glm.ElasticNet

class scikits.learn.glm.ElasticNet(alpha=1.0, rho=0.5, coef_=None, fit_intercept=True)

Linear Model trained with L1 and L2 prior as regularizer

rho=1 is the lasso penalty. Currently, rho <= 0.01 is not reliable, unless you supply your own sequence of alpha.

Parameters :

alpha : float

Constant that multiplies the L1 term. Defaults to 1.0

rho : float

The ElasticNet mixing parameter, with 0 < rho <= 1.

coef: ndarray of shape n_features :

The initial coeffients to warm-start the optimization

fit_intercept: bool :

Whether the intercept should be estimated or not. If False, the data is assumed to be already centered.

Methods

fit
predict
score
__init__(alpha=1.0, rho=0.5, coef_=None, fit_intercept=True)
fit(X, Y, maxit=1000, tol=0.0001, **params)

Fit Elastic Net model with coordinate descent

predict(X)

Predict using the linear model

Parameters :

X : numpy array of shape [n_samples, n_features]

Returns :

C : array, shape = [n_samples]

Returns predicted values.

score(X, y)

Returns the explained variance of the prediction

Parameters :

X : array-like, shape = [n_samples, n_features]

Training set.

y : array-like, shape = [n_samples]

Returns :

z : float