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