Package org.apache.spark.ml.regression
Class LinearRegressionSummary
Object
org.apache.spark.ml.regression.LinearRegressionSummary
- All Implemented Interfaces:
Serializable
,scala.Serializable
- Direct Known Subclasses:
LinearRegressionTrainingSummary
Linear regression results evaluated on a dataset.
param: predictions predictions output by the model's transform
method.
param: predictionCol Field in "predictions" which gives the predicted value of the label at
each instance.
param: labelCol Field in "predictions" which gives the true label of each instance.
param: featuresCol Field in "predictions" which gives the features of each instance as a vector.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondouble[]
long
Degrees of freedomdouble[]
double
Returns the explained variance regression score.labelCol()
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.double
Returns the mean squared error, which is a risk function corresponding to the expected value of the squared error loss or quadratic loss.long
double[]
pValues()
double
r2()
Returns R^2^, the coefficient of determination.double
r2adj()
Returns Adjusted R^2^, the adjusted coefficient of determination.double
Returns the root mean squared error, which is defined as the square root of the mean squared error.double[]
tValues()
-
Method Details
-
coefficientStandardErrors
public double[] coefficientStandardErrors() -
degreesOfFreedom
public long degreesOfFreedom()Degrees of freedom -
devianceResiduals
public double[] devianceResiduals() -
explainedVariance
public double explainedVariance()Returns the explained variance regression score. explainedVariance = 1 - variance(y - \hat{y}) / variance(y) Reference: Wikipedia explain variation- Returns:
- (undocumented)
-
featuresCol
-
labelCol
-
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)
-
numInstances
public long numInstances() -
pValues
public double[] pValues() -
predictionCol
-
predictions
-
r2
public double r2()Returns R^2^, the coefficient of determination. Reference: Wikipedia coefficient of determination- Returns:
- (undocumented)
-
r2adj
public double r2adj()Returns Adjusted R^2^, the adjusted coefficient of determination. Reference: Wikipedia coefficient of determination- Returns:
- (undocumented)
-
residuals
-
rootMeanSquaredError
public double rootMeanSquaredError()Returns the root mean squared error, which is defined as the square root of the mean squared error.- Returns:
- (undocumented)
-
tValues
public double[] tValues()
-