public class R2 extends java.lang.Object implements RegressionMetric
Constructor and Description |
---|
R2() |
Modifier and Type | Method and Description |
---|---|
static double |
of(double[] truth,
double[] prediction)
Calculates the R squared coefficient.
|
double |
score(double[] truth,
double[] prediction)
Returns a score to measure the quality of regression.
|
java.lang.String |
toString() |
public static final R2 instance
public double score(double[] truth, double[] prediction)
RegressionMetric
score
in interface RegressionMetric
truth
- the true response values.prediction
- the predicted response values.public static double of(double[] truth, double[] prediction)
public java.lang.String toString()
toString
in class java.lang.Object