示例#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;
 }
示例#2
0
 @Override
 public double predict(RealVector x) {
   return weights.dotProduct(x);
 }