Exemple #1
0
 @Override
 public double learn(RealVector x, double y) {
   prediction = predict(x);
   target = y;
   error = target - prediction;
   weights.addToSelf(x.mapMultiply(alpha * error));
   return error;
 }
Exemple #2
0
 @Override
 public double predict(RealVector x) {
   return weights.dotProduct(x);
 }