Multidimensional polynomial regression (preferably C / C ++, Java, or Scala)

Given a set of (N + 1) -dimensional real vectors with N independent and 1 dependent value, I would like to calculate a polynomial of degree 1 (linear), 2 (quadratic) or higher, which provides good enough (for example, as determined by a least squares error) ) In other words, when applied to collection elements, a polynomial must match the independent values โ€‹โ€‹of each of them with the corresponding dependent value (with some reasonable margin of error).

I expect that the dimension of independent variables will be in the range of 2..8 and work with element collections on 20..200. I hope to place the polynomial in milliseconds, not seconds. :-)

I quickly found polynomial regression algorithms for one-dimensional data, but I could not come up with anything practical for multidimensional data. What interests me most is the descriptions of the algorithms or the source code. Any pointers?

+6
source share
2 answers

You might want to explore the Weka data mining and machine learning platform - it is extremely comprehensive and includes all sorts of different regression algorithms.

The big advantage is that it's all open source, so you can also study the code if you want.

+3
source

I was looking for the exact same code and I found two good examples of this.

See net.sourceforge.openforecast

In particular, see the PolynomialRegressionModel class as a starting point

and a simple implementation of one class, which is designed for much larger datasets than you mentioned

http://blog.locut.us/2009/11/14/polynomial-regression-on-a-large-dataset-in-java/

0
source

Source: https://habr.com/ru/post/891958/


All Articles