org.apache.spark.mllib.evaluation
Class RegressionMetrics

Object
  extended by org.apache.spark.mllib.evaluation.RegressionMetrics
All Implemented Interfaces:
Logging

public class RegressionMetrics
extends Object
implements Logging

:: Experimental :: Evaluator for regression.

param: predictionAndObservations an RDD of (prediction, observation) pairs.


Constructor Summary
RegressionMetrics(RDD<scala.Tuple2<Object,Object>> predictionAndObservations)
           
 
Method Summary
 double explainedVariance()
          Returns the explained variance regression score.
 double meanAbsoluteError()
          Returns the mean absolute error, which is a risk function corresponding to the expected value of the absolute error loss or l1-norm loss.
 double meanSquaredError()
          Returns the mean squared error, which is a risk function corresponding to the expected value of the squared error loss or quadratic loss.
 double r2()
          Returns R^2^, the coefficient of determination.
 double rootMeanSquaredError()
          Returns the root mean squared error, which is defined as the square root of the mean squared error.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.spark.Logging
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
 

Constructor Detail

RegressionMetrics

public RegressionMetrics(RDD<scala.Tuple2<Object,Object>> predictionAndObservations)
Method Detail

explainedVariance

public double explainedVariance()
Returns the explained variance regression score. explainedVariance = 1 - variance(y - \hat{y}) / variance(y) Reference: http://en.wikipedia.org/wiki/Explained_variation

Returns:
(undocumented)

meanAbsoluteError

public double meanAbsoluteError()
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:
(undocumented)

meanSquaredError

public double meanSquaredError()
Returns the mean squared error, which is a risk function corresponding to the expected value of the squared error loss or quadratic loss.

Returns:
(undocumented)

rootMeanSquaredError

public double rootMeanSquaredError()
Returns the root mean squared error, which is defined as the square root of the mean squared error.

Returns:
(undocumented)

r2

public double r2()
Returns R^2^, the coefficient of determination. Reference: http://en.wikipedia.org/wiki/Coefficient_of_determination

Returns:
(undocumented)