LinearRegressionSummary¶

class
pyspark.ml.regression.
LinearRegressionSummary
(java_obj=None)[source]¶ Linear regression results evaluated on a dataset.
New in version 2.0.0.
Attributes
Standard error of estimated coefficients and intercept.
Degrees of freedom.
The weighted residuals, the usual residuals rescaled by the square root of the instance weights.
Returns the explained variance regression score.
Field in “predictions” which gives the features of each instance as a vector.
Field in “predictions” which gives the true label of each instance.
Returns the mean absolute error, which is a risk function corresponding to the expected value of the absolute error loss or l1norm loss.
Returns the mean squared error, which is a risk function corresponding to the expected value of the squared error loss or quadratic loss.
Number of instances in DataFrame predictions
Twosided pvalue of estimated coefficients and intercept.
Field in “predictions” which gives the predicted value of the label at each instance.
Dataframe outputted by the model’s transform method.
Returns R^2, the coefficient of determination.
Returns Adjusted R^2, the adjusted coefficient of determination.
Residuals (label  predicted value)
Returns the root mean squared error, which is defined as the square root of the mean squared error.
Tstatistic of estimated coefficients and intercept.
Attributes Documentation

coefficientStandardErrors
¶ Standard error of estimated coefficients and intercept. This value is only available when using the “normal” solver.
If
LinearRegression.fitIntercept
is set to True, then the last element returned corresponds to the intercept.New in version 2.0.0.
See also

degreesOfFreedom
¶ Degrees of freedom.
New in version 2.2.0.

devianceResiduals
¶ The weighted residuals, the usual residuals rescaled by the square root of the instance weights.
New in version 2.0.0.

explainedVariance
¶ Returns the explained variance regression score. explainedVariance = \(1  \frac{variance(y  \hat{y})}{variance(y)}\)
Notes
This ignores instance weights (setting all to 1.0) from LinearRegression.weightCol. This will change in later Spark versions.
For additional information see Explained variation on Wikipedia
New in version 2.0.0.

featuresCol
¶ Field in “predictions” which gives the features of each instance as a vector.
New in version 2.0.0.

labelCol
¶ Field in “predictions” which gives the true label of each instance.
New in version 2.0.0.

meanAbsoluteError
¶ Returns the mean absolute error, which is a risk function corresponding to the expected value of the absolute error loss or l1norm loss.
Notes
This ignores instance weights (setting all to 1.0) from LinearRegression.weightCol. This will change in later Spark versions.
New in version 2.0.0.

meanSquaredError
¶ Returns the mean squared error, which is a risk function corresponding to the expected value of the squared error loss or quadratic loss.
Notes
This ignores instance weights (setting all to 1.0) from LinearRegression.weightCol. This will change in later Spark versions.
New in version 2.0.0.

numInstances
¶ Number of instances in DataFrame predictions
New in version 2.0.0.

pValues
¶ Twosided pvalue of estimated coefficients and intercept. This value is only available when using the “normal” solver.
If
LinearRegression.fitIntercept
is set to True, then the last element returned corresponds to the intercept.New in version 2.0.0.
See also

predictionCol
¶ Field in “predictions” which gives the predicted value of the label at each instance.
New in version 2.0.0.

predictions
¶ Dataframe outputted by the model’s transform method.
New in version 2.0.0.

r2
¶ Returns R^2, the coefficient of determination.
Notes
This ignores instance weights (setting all to 1.0) from LinearRegression.weightCol. This will change in later Spark versions.
See also Wikipedia coefficient of determination
New in version 2.0.0.

r2adj
¶ Returns Adjusted R^2, the adjusted coefficient of determination.
Notes
This ignores instance weights (setting all to 1.0) from LinearRegression.weightCol. This will change in later Spark versions.
Wikipedia coefficient of determination, Adjusted R^2
New in version 2.4.0.

residuals
¶ Residuals (label  predicted value)
New in version 2.0.0.

rootMeanSquaredError
¶ Returns the root mean squared error, which is defined as the square root of the mean squared error.
Notes
This ignores instance weights (setting all to 1.0) from LinearRegression.weightCol. This will change in later Spark versions.
New in version 2.0.0.

tValues
¶ Tstatistic of estimated coefficients and intercept. This value is only available when using the “normal” solver.
If
LinearRegression.fitIntercept
is set to True, then the last element returned corresponds to the intercept.New in version 2.0.0.
See also
