new RegressionMetrics(predictionAndObservations, predictionAndObservations)
Evaluator for regression.
Parameters:
Name | Type | Description |
---|---|---|
predictionAndObservations |
an RDD of (prediction, observation) pairs. | |
predictionAndObservations |
module:eclairjs.RDD |
Methods
explainedVariance() → {number}
Returns the variance explained by regression.
explainedVariance = \sum_i (\hat{y_i} - \bar{y})^2 / n
- Source:
- See:
-
- [[https://en.wikipedia.org/wiki/Fraction_of_variance_unexplained]]
Returns:
- Type
- number
meanAbsoluteError() → {number}
Returns the mean absolute error, which is a risk function corresponding to the
expected value of the absolute error loss or l1-norm loss.
Returns:
- Type
- number
meanSquaredError() → {number}
Returns the mean squared error, which is a risk function corresponding to the
expected value of the squared error loss or quadratic loss.
Returns:
- Type
- number
r2() → {number}
Returns R^2^, the unadjusted coefficient of determination.
- Source:
- See:
-
- [[http://en.wikipedia.org/wiki/Coefficient_of_determination]]
Returns:
- Type
- number
rootMeanSquaredError() → {number}
Returns the root mean squared error, which is defined as the square root of
the mean squared error.
Returns:
- Type
- number