I am using OLSMultipleLinearRegression from Apache Commons Math in order to do curve fitting and it works pretty well and is really performant. However, this way I get an overfit as all variables are included in the model. Simply deleting the least predictive independent variables does not solve the problem.
Question: I am looking for a stepwise regression procedure in Java or information how to implement this with Apache Commons Math. I need a pure Java solution, so I cannot use R.