Accord.Math.Optimization.GaussNewton.ComputeError C# (CSharp) Method

ComputeError() public method

Compute model error for a given data set.
public ComputeError ( double input, double output ) : double
input double The input points.
output double The output points.
return double
        public double ComputeError(double[][] input, double[] output)
        {
            double sumOfSquaredErrors = 0;

            for (int i = 0; i < input.Length; i++)
            {
                double y = Function(weights, input[i]);

                double e = y - output[i];
                sumOfSquaredErrors += e * e;
            }

            return sumOfSquaredErrors;
        }