R2 method

double R2()

Returns the coefficient of determination R2. return the coefficient of determination R2, which is a real number between 0 and 1

Implementation

double R2() {
  if (sst == 0.0) return 1.0; // constant function
  return 1.0 - sse / sst;
}