LogisticRegressionSummary¶

class
pyspark.ml.classification.
LogisticRegressionSummary
(java_obj=None)[source]¶ Abstraction for Logistic Regression Results for a given model.
New in version 2.0.0.
Methods
fMeasureByLabel
([beta])Returns fmeasure for each label (category).
weightedFMeasure
([beta])Returns weighted averaged fmeasure.
Attributes
Returns accuracy.
Returns false positive rate for each label (category).
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 sequence of labels in ascending order.
Returns precision for each label (category).
Field in “predictions” which gives the prediction of each class.
Dataframe outputted by the model’s transform method.
Field in “predictions” which gives the probability of each class as a vector.
Returns recall for each label (category).
Returns true positive rate for each label (category).
Field in “predictions” which gives the weight of each instance as a vector.
Returns weighted false positive rate.
Returns weighted averaged precision.
Returns weighted averaged recall.
Returns weighted true positive rate.
Methods Documentation

fMeasureByLabel
(beta=1.0)¶ Returns fmeasure for each label (category).
New in version 3.1.0.

weightedFMeasure
(beta=1.0)¶ Returns weighted averaged fmeasure.
New in version 3.1.0.
Attributes Documentation

accuracy
¶ Returns accuracy. (equals to the total number of correctly classified instances out of the total number of instances.)
New in version 3.1.0.

falsePositiveRateByLabel
¶ Returns false positive rate for each label (category).
New in version 3.1.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 3.1.0.

labels
¶ Returns the sequence of labels in ascending order. This order matches the order used in metrics which are specified as arrays over labels, e.g., truePositiveRateByLabel.
New in version 3.1.0.
Notes
In most cases, it will be values {0.0, 1.0, …, numClasses1}, However, if the training set is missing a label, then all of the arrays over labels (e.g., from truePositiveRateByLabel) will be of length numClasses1 instead of the expected numClasses.

precisionByLabel
¶ Returns precision for each label (category).
New in version 3.1.0.

predictionCol
¶ Field in “predictions” which gives the prediction of each class.
New in version 3.1.0.

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

probabilityCol
¶ Field in “predictions” which gives the probability of each class as a vector.
New in version 2.0.0.

recallByLabel
¶ Returns recall for each label (category).
New in version 3.1.0.

truePositiveRateByLabel
¶ Returns true positive rate for each label (category).
New in version 3.1.0.

weightCol
¶ Field in “predictions” which gives the weight of each instance as a vector.
New in version 3.1.0.

weightedFalsePositiveRate
¶ Returns weighted false positive rate.
New in version 3.1.0.

weightedPrecision
¶ Returns weighted averaged precision.
New in version 3.1.0.

weightedRecall
¶ Returns weighted averaged recall. (equals to precision, recall and fmeasure)
New in version 3.1.0.

weightedTruePositiveRate
¶ Returns weighted true positive rate. (equals to precision, recall and fmeasure)
New in version 3.1.0.
