]> granicus.if.org Git - liblinear/commit
Automatic switching from dual CD to primal Newton if slow convergence occurs.
authorChih-Jen Lin <cjlin@csie.ntu.edu.tw>
Tue, 20 Oct 2020 23:57:44 +0000 (07:57 +0800)
committerChih-Jen Lin <cjlin@csie.ntu.edu.tw>
Tue, 20 Oct 2020 23:57:44 +0000 (07:57 +0800)
commite749bc450425afcce4242e797b1740947ab6c4b6
tree49ca25f0cd1f38ca31d04eeaebc620253a026e6e
parent7b0193baec9a443684e4a079ae4a2040971f67cf
Automatic switching from dual CD to primal Newton if slow convergence occurs.

For l2-regularized logistic regression and L2-loss linear SVM,
liblinear provides two types of solvers: dual CD and primal Newton.
They are respectively first-order and second-order methods,
and are suitable under different circumstances.

The default solver (dual CD) may be slow
in some situations (e.g., data not scaled). In the past,
if slow convergence occurs, liblinear
issues a warning message suggesting users to use the
primal Newton method. In this commit this switch becomes automatic
to ensure that a reasonably good approximate solution of the
optimization problem is directly returned to the user.

The main change is in train_one(). It checks if iter of dual CD >= max_iter
and then switch to call primal Newton. Stopping tolerance is also adjusted.

minor changes:
- in comments tabs replaced with spaces
- for calling dual solvers, instead of passing individual parameters, the structure param is now passed
linear.cpp