code: public static double ssError(double[] predictedValues, double[] targetAttribute) {
          double ret = 0;
          for (int i = 0; i < predictedValues.length; i++) {
              ret += Math.pow(targetAttribute[i] - predictedValues[i], 2);
          }
          return ret;
  
      }
docs: How much of the variance is NOT explained by the regression
  @param predictedValues predicted values
  @param targetAttribute data for target attribute
  @return the sum squares of regression