dislib.regression.Lasso

ADMM Lasso

@Authors: Aleksandar Armacki and Lidija Fodor @Affiliation: Faculty of Sciences, University of Novi Sad, Serbia

This work is supported by the I-BiDaaS project, funded by the European Commission under Grant Agreement No. 780787.

class dislib.regression.lasso.base.Lasso(lmbd=0.001, rho=1, max_iter=100, atol=0.0001, rtol=0.01, verbose=False)[source]

Bases: sklearn.base.BaseEstimator

Lasso represents the Least Absolute Shrinkage and Selection Operator (Lasso) for regression analysis, solved in a distributed manner with ADMM.

Parameters:
  • lmbd (float, optional (default=1e-3)) – The regularization parameter for Lasso regression.
  • rho (float, optional (default=1)) – The penalty parameter for constraint violation.
  • max_iter (int, optional (default=100)) – The maximum number of iterations of ADMM.
  • atol (float, optional (default=1e-4)) – The absolute tolerance used to calculate the early stop criterion for ADMM.
  • rtol (float, optional (default=1e-2)) – The relative tolerance used to calculate the early stop criterion for ADMM.
  • verbose (boolean, optional (default=False)) – Whether to print information about the optimization process.
Variables:
  • coef (ds-array, shape=(1, n_features)) – Parameter vector.
  • n_iter (int) – Number of iterations run by ADMM.
  • converged (boolean) – Whether ADMM converged.

See also

ADMM

fit(x, y)[source]

Fits the model with training data. Optimization is carried out using ADMM.

Parameters:
  • x (ds-array, shape=(n_samples, n_features)) – Training samples.
  • y (ds-array, shape=(n_samples, 1)) – Class labels of x.
Returns:

self

Return type:

Lasso

fit_predict(x)[source]

Fits the model and predicts using the same data.

Parameters:x (ds-array, shape=(n_samples, n_features)) – Training samples.
Returns:y – Predicted values.
Return type:ds-array, shape=(n_samples, 1)
predict(x)[source]

Predict using the linear model.

Parameters:x (ds-array, shape=(n_samples, n_features)) – Samples.
Returns:y – Predicted values.
Return type:ds-array, shape=(n_samples, 1)