src/main/java/convnet/NumPute.java
/**
     * Sum of squares error on 1d result vector against 1d result vector from supervised training data.
     * @param y
     * @param yHat
     * @return
     */
Sum of squares error on 1d result vector against 1d result vector from supervised training data.
@param y
@param yHat
@return
Sum of squares error on 1d result vector against 1d result vector from supervised training data . @param y @param yHat @return
public static double sse(double[] y, double[] yHat) {
        int yL = y.length;
        int yHatL = yHat.length;
        double sumSq = 0;
        if (yL != yHatL) {
            throw new RuntimeException("Cannot determine error of unmatched matrices.");
        }
        for (int i = 0; i < yL; i++) {
            sumSq += Math.pow((y[i] - yHat[i]), 2);
        }
        return sumSq;
    }
public static double sse ( double [ ] y , double [ ] yHat ) { int yL = y . length ; int yHatL = yHat . length ; double sumSq = 0 ; if ( yL != yHatL ) { throw new RuntimeException ( "Cannot determine error of unmatched matrices." ) ; } for ( int i = 0 ; i < yL ; i ++ ) { sumSq += Math . pow ( ( y [ i ] - yHat [ i ] ) , 2 ) ; } return sumSq ; }
Sum of squares error on 1d result vector against 1d result vector from supervised training data.
Sum of squares error on 1d result vector against 1d result vector from supervised training data .