mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-25 05:23:51 +00:00
Adjusted regression algorithm
-used constant alpha -different test case -still a problem with huuuge weigths
This commit is contained in:
1 parent
7504986f6b
commit
be98b84324
2 files changed
+90
-20
No files matched your search
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user