An example of regularized Poisson regression (AKA log-linear regression, AKA multiplicative balanced minimum bias, AKA a GLM with Poisson errors and a log link) in Java. Poisson regression is probably more useful than you think, see http://nyeggen.com/post/2012-07-25-poisson-regression-its-more-useful-than-you-think/ Depends on the wonderful Mallet optimization routines, and happens to use the Apache Commons Math linear algebra packages. It's easily adaptable to use any other vector representation, or raw arrays. Also somewhat easily adaptable to use other optimization routines that only depend on loglikelihood and gradients (not Hessians, unless you want to look up the formula).
bnyeggen/Regularized-Poisson-Regression
Poisson regression, with L2 regularization, in Java
JavaNOASSERTION