class RegressionMetrics extends Logging
Evaluator for regression.
- Annotations
- @Since( "1.2.0" )
- Source
- RegressionMetrics.scala
- Alphabetic
- By Inheritance
- RegressionMetrics
- Logging
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
RegressionMetrics(predictionAndObservations: RDD[_ <: Product])
- Annotations
- @Since( "1.2.0" )
-
new
RegressionMetrics(predictionAndObservations: RDD[_ <: Product], throughOrigin: Boolean)
- predictionAndObservations
an RDD of either (prediction, observation, weight) or (prediction, observation) pairs
- throughOrigin
True if the regression is through the origin. For example, in linear regression, it will be true without fitting intercept.
- Annotations
- @Since( "2.0.0" )
Value Members
-
def
explainedVariance: Double
Returns the variance explained by regression.
Returns the variance explained by regression. explainedVariance = $\sum_i (\hat{y_i} - \bar{y})2 / n$
- Annotations
- @Since( "1.2.0" )
- See also
-
def
meanAbsoluteError: Double
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 the mean absolute error, which is a risk function corresponding to the expected value of the absolute error loss or l1-norm loss.
- Annotations
- @Since( "1.2.0" )
-
def
meanSquaredError: Double
Returns the mean squared error, which is a risk function corresponding to the expected value of the squared error loss or quadratic loss.
Returns the mean squared error, which is a risk function corresponding to the expected value of the squared error loss or quadratic loss.
- Annotations
- @Since( "1.2.0" )
-
def
r2: Double
Returns R2, the unadjusted coefficient of determination.
Returns R2, the unadjusted coefficient of determination.
- Annotations
- @Since( "1.2.0" )
- See also
Coefficient of determination (Wikipedia) In case of regression through the origin, the definition of R2 is to be modified.
J. G. Eisenhauer, Regression through the Origin. Teaching Statistics 25, 76-80 (2003)
-
def
rootMeanSquaredError: Double
Returns the root mean squared error, which is defined as the square root of the mean squared error.
Returns the root mean squared error, which is defined as the square root of the mean squared error.
- Annotations
- @Since( "1.2.0" )