sparse_ho.models.SparseLogreg¶
- 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
- Parameters
- estimator: sklearn estimator
Estimator used to solve the optimization problem. Must follow the scikit-learn API.
- __init__(estimator=None)¶
Methods
__init__([estimator])generalized_supp(X, v, log_alpha)Generalized support of iterate.
get_L(X)Compute Lipschitz constant of datafit.
get_beta(X, y, mask, dense)Return primal iterate.
get_full_jac_v(mask, jac_v, n_features)TODO
get_jac_residual_norm(Xs, ys, n_samples, ...)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.