/** * <summary> The calculateRMinusY method creates a new {@link java.util.Vector} with given Instance, then it multiplies given * input Vector with given weights Matrix. After normalizing the output, it return the difference between the newly created * Vector and normalized output.</summary> * * <param name="instance">Instance is used to get class labels.</param> * <param name="input"> Vector to multiply weights.</param> * <param name="weights"> Matrix of weights/</param> * <returns>Difference between newly created Vector and normalized output.</returns> */ protected Vector CalculateRMinusY(Instance.Instance instance, Vector input, Matrix weights) { r = new Vector(K, classLabels.IndexOf(instance.GetClassLabel()), 1.0); var o = weights.MultiplyWithVectorFromRight(input); y = NormalizeOutput(o); return(r.Difference(y)); }