Package org.apache.spark.ml.regression
Class LinearRegressionSummary
Object
org.apache.spark.ml.regression.LinearRegressionSummary
- All Implemented Interfaces:
- Serializable,- Summary
- 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.
 param:  coefficientArray Coefficients of the linear regression model, only necessary when
                         diagInvAtWA is not Array(0).
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptiondouble[]longDegrees of freedomdouble[]doubleReturns the explained variance regression score.labelCol()doubleReturns the mean absolute error, which is a risk function corresponding to the expected value of the absolute error loss or l1-norm loss.doubleReturns the mean squared error, which is a risk function corresponding to the expected value of the squared error loss or quadratic loss.longdouble[]pValues()doubler2()Returns R^2^, the coefficient of determination.doubler2adj()Returns Adjusted R^2^, the adjusted coefficient of determination.doubleReturns the root mean squared error, which is defined as the square root of the mean squared error.double[]tValues()
- 
Method Details- 
predictions
- 
predictionCol
- 
labelCol
- 
featuresCol
- 
explainedVariancepublic double explainedVariance()Returns the explained variance regression score. explainedVariance = 1 - variance(y - \hat{y}) / variance(y) Reference: Wikipedia explain variation- Returns:
- (undocumented)
 
- 
meanAbsoluteErrorpublic 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)
 
- 
meanSquaredErrorpublic 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)
 
- 
rootMeanSquaredErrorpublic double rootMeanSquaredError()Returns the root mean squared error, which is defined as the square root of the mean squared error.- Returns:
- (undocumented)
 
- 
r2public double r2()Returns R^2^, the coefficient of determination. Reference: Wikipedia coefficient of determination- Returns:
- (undocumented)
 
- 
r2adjpublic double r2adj()Returns Adjusted R^2^, the adjusted coefficient of determination. Reference: Wikipedia coefficient of determination- Returns:
- (undocumented)
 
- 
residuals
- 
numInstancespublic long numInstances()
- 
degreesOfFreedompublic long degreesOfFreedom()Degrees of freedom
- 
devianceResidualspublic double[] devianceResiduals()
- 
coefficientStandardErrorspublic double[] coefficientStandardErrors()
- 
tValuespublic double[] tValues()
- 
pValuespublic double[] pValues()
 
-