BinaryLogisticRegressionSummaryImpl (Spark 3.5.5 JavaDoc) (original) (raw)
Object
- org.apache.spark.ml.classification.LogisticRegressionSummaryImpl
- org.apache.spark.ml.classification.BinaryLogisticRegressionSummaryImpl
All Implemented Interfaces:
java.io.Serializable, BinaryClassificationSummary, BinaryLogisticRegressionSummary, ClassificationSummary, LogisticRegressionSummary
Direct Known Subclasses:
BinaryLogisticRegressionTrainingSummaryImpl
public class BinaryLogisticRegressionSummaryImpl
extends LogisticRegressionSummaryImpl
implements BinaryLogisticRegressionSummary
Binary logistic regression results for a given model.
param: predictions dataframe output by the model's transform
method. param: probabilityCol field in "predictions" which gives the probability of each class as a vector. param: predictionCol field in "predictions" which gives the prediction of each class as a double. 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: weightCol field in "predictions" which gives the weight of each instance.
See Also:
Serialized Form
Constructor Summary
Constructors
Constructor and Description BinaryLogisticRegressionSummaryImpl(Dataset<Row> predictions, String probabilityCol, String predictionCol, String labelCol, String featuresCol, String weightCol) Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method and Description double areaUnderROC() Computes the area under the receiver operating characteristic (ROC) curve. Dataset<Row> fMeasureByThreshold() Returns a dataframe with two fields (threshold, F-Measure) curve with beta = 1.0. Dataset<Row> pr() Returns the precision-recall curve, which is a Dataframe containing two fields recall, precision with (0.0, 1.0) prepended to it. Dataset<Row> precisionByThreshold() Returns a dataframe with two fields (threshold, precision) curve. Dataset<Row> recallByThreshold() Returns a dataframe with two fields (threshold, recall) curve. Dataset<Row> roc() Returns the receiver operating characteristic (ROC) curve, which is a Dataframe having two fields (FPR, TPR) with (0.0, 0.0) prepended and (1.0, 1.0) appended to it. * ### Methods inherited from class org.apache.spark.ml.classification.[LogisticRegressionSummaryImpl](../../../../../org/apache/spark/ml/classification/LogisticRegressionSummaryImpl.html "class in org.apache.spark.ml.classification") `[featuresCol](../../../../../org/apache/spark/ml/classification/LogisticRegressionSummaryImpl.html#featuresCol--), [labelCol](../../../../../org/apache/spark/ml/classification/LogisticRegressionSummaryImpl.html#labelCol--), [predictionCol](../../../../../org/apache/spark/ml/classification/LogisticRegressionSummaryImpl.html#predictionCol--), [predictions](../../../../../org/apache/spark/ml/classification/LogisticRegressionSummaryImpl.html#predictions--), [probabilityCol](../../../../../org/apache/spark/ml/classification/LogisticRegressionSummaryImpl.html#probabilityCol--), [weightCol](../../../../../org/apache/spark/ml/classification/LogisticRegressionSummaryImpl.html#weightCol--)` * ### Methods inherited from class Object `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait` * ### Methods inherited from interface org.apache.spark.ml.classification.[BinaryLogisticRegressionSummary](../../../../../org/apache/spark/ml/classification/BinaryLogisticRegressionSummary.html "interface in org.apache.spark.ml.classification") `[scoreCol](../../../../../org/apache/spark/ml/classification/BinaryLogisticRegressionSummary.html#scoreCol--)` * ### Methods inherited from interface org.apache.spark.ml.classification.[LogisticRegressionSummary](../../../../../org/apache/spark/ml/classification/LogisticRegressionSummary.html "interface in org.apache.spark.ml.classification") `[asBinary](../../../../../org/apache/spark/ml/classification/LogisticRegressionSummary.html#asBinary--), [featuresCol](../../../../../org/apache/spark/ml/classification/LogisticRegressionSummary.html#featuresCol--), [probabilityCol](../../../../../org/apache/spark/ml/classification/LogisticRegressionSummary.html#probabilityCol--)` * ### Methods inherited from interface org.apache.spark.ml.classification.[ClassificationSummary](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html "interface in org.apache.spark.ml.classification") `[accuracy](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#accuracy--), [falsePositiveRateByLabel](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#falsePositiveRateByLabel--), [fMeasureByLabel](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#fMeasureByLabel--), [fMeasureByLabel](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#fMeasureByLabel-double-), [labelCol](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#labelCol--), [labels](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#labels--), [precisionByLabel](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#precisionByLabel--), [predictionCol](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#predictionCol--), [predictions](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#predictions--), [recallByLabel](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#recallByLabel--), [truePositiveRateByLabel](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#truePositiveRateByLabel--), [weightCol](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#weightCol--), [weightedFalsePositiveRate](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#weightedFalsePositiveRate--), [weightedFMeasure](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#weightedFMeasure--), [weightedFMeasure](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#weightedFMeasure-double-), [weightedPrecision](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#weightedPrecision--), [weightedRecall](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#weightedRecall--), [weightedTruePositiveRate](../../../../../org/apache/spark/ml/classification/ClassificationSummary.html#weightedTruePositiveRate--)`
Constructor Detail
* #### BinaryLogisticRegressionSummaryImpl public BinaryLogisticRegressionSummaryImpl([Dataset](../../../../../org/apache/spark/sql/Dataset.html "class in org.apache.spark.sql")<[Row](../../../../../org/apache/spark/sql/Row.html "interface in org.apache.spark.sql")> predictions, String probabilityCol, String predictionCol, String labelCol, String featuresCol, String weightCol)
Method Detail
* #### areaUnderROC public double areaUnderROC() Computes the area under the receiver operating characteristic (ROC) curve. Specified by: `[areaUnderROC](../../../../../org/apache/spark/ml/classification/BinaryClassificationSummary.html#areaUnderROC--)` in interface `[BinaryClassificationSummary](../../../../../org/apache/spark/ml/classification/BinaryClassificationSummary.html "interface in org.apache.spark.ml.classification")` Returns: (undocumented) * #### fMeasureByThreshold public [Dataset](../../../../../org/apache/spark/sql/Dataset.html "class in org.apache.spark.sql")<[Row](../../../../../org/apache/spark/sql/Row.html "interface in org.apache.spark.sql")> fMeasureByThreshold() Returns a dataframe with two fields (threshold, F-Measure) curve with beta = 1.0. Specified by: `[fMeasureByThreshold](../../../../../org/apache/spark/ml/classification/BinaryClassificationSummary.html#fMeasureByThreshold--)` in interface `[BinaryClassificationSummary](../../../../../org/apache/spark/ml/classification/BinaryClassificationSummary.html "interface in org.apache.spark.ml.classification")` Returns: (undocumented) * #### pr public [Dataset](../../../../../org/apache/spark/sql/Dataset.html "class in org.apache.spark.sql")<[Row](../../../../../org/apache/spark/sql/Row.html "interface in org.apache.spark.sql")> pr() Returns the precision-recall curve, which is a Dataframe containing two fields recall, precision with (0.0, 1.0) prepended to it. Specified by: `[pr](../../../../../org/apache/spark/ml/classification/BinaryClassificationSummary.html#pr--)` in interface `[BinaryClassificationSummary](../../../../../org/apache/spark/ml/classification/BinaryClassificationSummary.html "interface in org.apache.spark.ml.classification")` Returns: (undocumented) * #### precisionByThreshold public [Dataset](../../../../../org/apache/spark/sql/Dataset.html "class in org.apache.spark.sql")<[Row](../../../../../org/apache/spark/sql/Row.html "interface in org.apache.spark.sql")> precisionByThreshold() Returns a dataframe with two fields (threshold, precision) curve. Every possible probability obtained in transforming the dataset are used as thresholds used in calculating the precision. Specified by: `[precisionByThreshold](../../../../../org/apache/spark/ml/classification/BinaryClassificationSummary.html#precisionByThreshold--)` in interface `[BinaryClassificationSummary](../../../../../org/apache/spark/ml/classification/BinaryClassificationSummary.html "interface in org.apache.spark.ml.classification")` Returns: (undocumented) * #### recallByThreshold public [Dataset](../../../../../org/apache/spark/sql/Dataset.html "class in org.apache.spark.sql")<[Row](../../../../../org/apache/spark/sql/Row.html "interface in org.apache.spark.sql")> recallByThreshold() Returns a dataframe with two fields (threshold, recall) curve. Every possible probability obtained in transforming the dataset are used as thresholds used in calculating the recall. Specified by: `[recallByThreshold](../../../../../org/apache/spark/ml/classification/BinaryClassificationSummary.html#recallByThreshold--)` in interface `[BinaryClassificationSummary](../../../../../org/apache/spark/ml/classification/BinaryClassificationSummary.html "interface in org.apache.spark.ml.classification")` Returns: (undocumented) * #### roc public [Dataset](../../../../../org/apache/spark/sql/Dataset.html "class in org.apache.spark.sql")<[Row](../../../../../org/apache/spark/sql/Row.html "interface in org.apache.spark.sql")> roc() Returns the receiver operating characteristic (ROC) curve, which is a Dataframe having two fields (FPR, TPR) with (0.0, 0.0) prepended and (1.0, 1.0) appended to it. See http://en.wikipedia.org/wiki/Receiver\_operating\_characteristic Specified by: `[roc](../../../../../org/apache/spark/ml/classification/BinaryClassificationSummary.html#roc--)` in interface `[BinaryClassificationSummary](../../../../../org/apache/spark/ml/classification/BinaryClassificationSummary.html "interface in org.apache.spark.ml.classification")` Returns: (undocumented)