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