Class: RegressionMetrics

eclairjs/mllib/evaluation.RegressionMetrics

new RegressionMetrics(predictionAndObservations, predictionAndObservations)

Evaluator for regression.
Parameters:
Name Type Description
predictionAndObservations an RDD of (prediction, observation) pairs.
predictionAndObservations module:eclairjs/rdd.RDD
Source:

Methods

explainedVariance() → {Promise.<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:
A Promise that resolves to the variance explained by regression.
Type
Promise.<Number>

meanAbsoluteError() → {Promise.<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.
Source:
Returns:
A Promise that resolves to the absolute mean.
Type
Promise.<Number>

meanSquaredError() → {Promise.<Number>}

Returns the mean squared error, which is a risk function corresponding to the expected value of the squared error loss or quadratic loss.
Source:
Returns:
A Promise that resolves to the mean squared error.
Type
Promise.<Number>

r2() → {Promise.<Number>}

Returns R^2^, the unadjusted coefficient of determination.
Source:
See:
  • [[http://en.wikipedia.org/wiki/Coefficient_of_determination]] In case of regression through the origin, the definition of R^2^ is to be modified.
  • J. G. Eisenhauer, Regression through the Origin. Teaching Statistics 25, 76-80 (2003) [[https://online.stat.psu.edu/~ajw13/stat501/SpecialTopics/Reg_thru_origin.pdf]]
Returns:
A Promise that resolves to the result.
Type
Promise.<Number>

rootMeanSquaredError() → {Promise.<Number>}

Returns the root mean squared error, which is defined as the square root of the mean squared error.
Source:
Returns:
A Promise that resolves to the root mean squared error.
Type
Promise.<Number>