There's more...

The LogisticRegressionWithLBFGS() object has a method called setNumClasses() that allows it to deal with multinomials (that is, more than two groups). By default, it is set to two, which is a binary logistic regression.

L-BFGS is a limited memory adaptation of the original BFGS (Broyden-Fletcher-Goldfarb-Shanno) method. L-BFGS is well suited for regression models that deal with a large number of variables. It is a form of BFGS approximation with limited memory in which it tries to estimate the Hessian matrix while searching through the large search space.

We encourage the reader to step back and look at the problem as regression plus an optimization technique (regression with SGD versus regression with L-BFGS). In this recipe, we used logistic regression, which itself is a form of linear regression except with discrete labels, plus an optimization algorithm (that is, we choose L-BFGS rather than SGD) to solve the problem.

In order to appreciate the details of L-BFGS, one must understand the Hessian matrix and its role, along with the concomitant difficulties with large numbers of parameters (Hessian or Jacobian techniques), especially when using a sparse matrix configuration in optimization.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.190.207.144