r2

fun r2(truth: DoubleArray, prediction: DoubleArray): Double(source)

R2 coefficient of determination measures how well the regression line approximates the real data points. An R2 of 1.0 indicates that the regression line perfectly fits the data.