class sparse_ho.models.SparseLogreg(estimator=None)

Sparse Logistic Regression classifier.

The objective function is:

sum_1^n_samples log(1 + e^{-y_i x_i^T w}) + 1. / C * ||w||_1

estimator: sklearn estimator

Estimator used to solve the optimization problem. Must follow the scikit-learn API.


Initialize self. See help(type(self)) for accurate signature.



Initialize self.

generalized_supp(X, v, log_alpha)

Generalized support of iterate.


Compute Lipschitz constant of datafit.

get_beta(X, y, mask, dense)

Return primal iterate.

get_full_jac_v(mask, jac_v, n_features)


get_jac_obj(Xs, ys, n_samples, sign_beta, …)

get_jac_v(X, y, mask, dense, jac, v)

Compute hypergradient.

get_mask_jac_v(mask, jac_v)

TODO I have the feeling this is not used anywhere

get_mat_vec(X, y, mask, dense, log_alpha)

Returns a LinearOperator computing the matrix vector product with the Hessian of datafit.

proj_hyperparam(X, y, log_alpha)

Project hyperparameter on an admissible range of values.

reduce_X(X, mask)

Reduce design matrix to generalized support.

reduce_y(y, mask)

Reduce observation vector to generalized support.

sign(x, log_alpha)

Get sign of iterate.