tick icon indicating copy to clipboard operation
tick copied to clipboard

Objective function formulation for Logistic Regression

Open fabian-sp opened this issue 2 years ago • 5 comments

Hi all,

I can not find the exact formulation of the objective function that is minimized in LogisticRegression. In particular, how exactly does C appear in the objective (e.g. if I want to do l1-penalization)?

Thank you!

fabian-sp avatar Jul 15 '22 11:07 fabian-sp

The parameter C is the inverse of the regularization strength. It's a convention also used by scikit-learn, see.

achab avatar Jul 15 '22 11:07 achab

Yes, but in scikit-learn the loss function values are not averaged. I believe that in tick you solve:

min 1/C ||x||_1 + 1/n \sum_{i=1}^n log(...)

fabian-sp avatar Jul 15 '22 11:07 fabian-sp

Indeed, there is a scaling difference

achab avatar Jul 15 '22 11:07 achab

Thanks! Another question I would have is: how can I set/access the starting point of a solver? So when using SVRG for logistic regression, what is the default starting point?

fabian-sp avatar Jul 19 '22 19:07 fabian-sp

Cf https://x-datainitiative.github.io/tick/modules/solver.html You can choose the one you want using the optim api otherwise it's zero I think (long time not using it)

stephanegaiffas avatar Jul 19 '22 19:07 stephanegaiffas