Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a Java library for better linear regression? (E.g., iteratively reweighted least squares) [closed]

I am struggling to find a way to perform better linear regression. I have been using the Moore-Penrose pseudoinverse and QR decomposition with JAMA library, but the results are not satisfactory. Would ojAlgo be useful? I have been hitting accuracy limits that I know should not be there. The algorithm should be capable of reducing the impact of an input variable to zero. Perhaps this takes the form of iteratively reweighted least squares, but I do not know that algorithm and cannot find a library for it. The output should be a weight matrix or vector such that matrix multiplication of the input matrix by the weight matrix will yield a prediction matrix. My input matrix will almost always have more rows than columns. Thank you for your help.

like image 732
user1062571 Avatar asked Dec 06 '11 20:12

user1062571


People also ask

Which library is used for linear regression?

As mentioned above, the NumPy library has an option that gives the user the possibility to perform a linear regression (simple and polynomial) by using the least square method as minimization criteria.

Which algorithm is used to get the best fit line for linear regression?

The more precise method involves the least squares method. This is a statistical procedure to find the best fit for a set of data points by minimizing the sum of the offsets or residuals of points from the plotted curve. This is the primary technique used in regression analysis.


2 Answers

I don't fully understand your question, but I've used Apache Commons Math to do linear regressions before.

like image 197
Dave Avatar answered Oct 24 '22 09:10

Dave


If you want to use a more generic external tool for this, use Octave. I think it's more suitable for these kind of things. If not, take a look to:

Logistic Regression in Java Specifically: http://commons.apache.org/math/userguide/overview.html

or http://mallet.cs.umass.edu/optimization.php

http://mahout.apache.org/

like image 1
Alejandro Diaz Avatar answered Oct 24 '22 08:10

Alejandro Diaz