EasyDeepLearn

How is logistic regression fit in practice?

medium

Answer

  • Two main approaches: (1) Iteratively Reweighted Least Squares (IRLS) — an implementation of Newton-Raphson on the log-likelihood.
  • Each iteration solves a weighted least squares problem with weights = p(1-p).
  • Converges in ~10-20 iterations for well-conditioned problems.
  • (2) First-order methods: L-BFGS, SAG, SAGA, SGD.
  • Better for large datasets and L1 penalty. scikit-learn uses 'lbfgs' by default; 'liblinear'/'saga' for L1.
Check yourself — multiple choice
  • Only closed-form matrix inversion
  • IRLS (Newton) or first-order methods (L-BFGS, SAGA)
  • By reduction to Naive Bayes
  • By solving XTX^{T} X w  =  XTw\; = \;X^{T} y

Iterative: IRLS/Newton for small data, L-BFGS/SAG/SAGA for large data.

#logistic-regression#optimization

Practise Supervised Learning

215 interview questions in this topic.

Related questions