Adjusted regression algorithm

-used constant alpha
-different test case
-still a problem with huuuge weigths
This commit is contained in:
Frederik Petersen committed 2015-01-21 18:19:18 +01:00
1 parent 7504986f6b
commit be98b84324
2 files changed
+90 -20

No files matched your search

@@ -42,12 +42,12 @@ public class OnlineMultiVariateRegressionImpl implements OnlineMultiVariateRegre
checkNumberOfDimensions(x);
numberOfAddedPoints++;
double[] newWeights = initializeDoubleArray(weights.length);
double alpha = 1.0/numberOfAddedPoints;
double alpha = 0.01;
newWeights[0] = weights[0] + alpha * (y - estimateY(x));
for (int i = 1; i < weights.length; i++) {
incrementallyUpdateVariances(x, i);
double normalizedInput = (x[i-1] - means[i-1]) / Math.sqrt(variances[i-1]);
newWeights[i] = weights[i] + alpha*(y - estimateY(x))*normalizedInput;
newWeights[i] = weights[i] + Math.pow(alpha, i)*(y - estimateY(x)) * x[i-1];//normalizedInput;
}
weights = newWeights;
}