ClassificationSummary (Spark 3.5.5 JavaDoc) (original) (raw)
- All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
BinaryClassificationSummary, BinaryLogisticRegressionSummary, BinaryLogisticRegressionTrainingSummary, BinaryRandomForestClassificationSummary, BinaryRandomForestClassificationTrainingSummary, FMClassificationSummary, FMClassificationTrainingSummary, LinearSVCSummary, LinearSVCTrainingSummary, LogisticRegressionSummary, LogisticRegressionTrainingSummary, MultilayerPerceptronClassificationSummary, MultilayerPerceptronClassificationTrainingSummary, RandomForestClassificationSummary, RandomForestClassificationTrainingSummary
All Known Implementing Classes:
BinaryLogisticRegressionSummaryImpl, BinaryLogisticRegressionTrainingSummaryImpl, BinaryRandomForestClassificationSummaryImpl, BinaryRandomForestClassificationTrainingSummaryImpl, FMClassificationSummaryImpl, FMClassificationTrainingSummaryImpl, LinearSVCSummaryImpl, LinearSVCTrainingSummaryImpl, LogisticRegressionSummaryImpl, LogisticRegressionTrainingSummaryImpl, MultilayerPerceptronClassificationSummaryImpl, MultilayerPerceptronClassificationTrainingSummaryImpl, RandomForestClassificationSummaryImpl, RandomForestClassificationTrainingSummaryImpl
public interface ClassificationSummary
extends scala.Serializable
Abstraction for multiclass classification results for a given model.
Method Summary
All Methods Instance Methods Abstract Methods
Modifier and Type Method and Description double accuracy() Returns accuracy. double[] falsePositiveRateByLabel() Returns false positive rate for each label (category). double[] fMeasureByLabel() Returns f1-measure for each label (category). double[] fMeasureByLabel(double beta) Returns f-measure for each label (category). String labelCol() Field in "predictions" which gives the true label of each instance (if available). double[] labels() Returns the sequence of labels in ascending order. double[] precisionByLabel() Returns precision for each label (category). String predictionCol() Field in "predictions" which gives the prediction of each class. Dataset<Row> predictions() Dataframe output by the model's transform method. double[] recallByLabel() Returns recall for each label (category). double[] truePositiveRateByLabel() Returns true positive rate for each label (category). String weightCol() Field in "predictions" which gives the weight of each instance. double weightedFalsePositiveRate() Returns weighted false positive rate. double weightedFMeasure() Returns weighted averaged f1-measure. double weightedFMeasure(double beta) Returns weighted averaged f-measure. double weightedPrecision() Returns weighted averaged precision. double weightedRecall() Returns weighted averaged recall. double weightedTruePositiveRate() Returns weighted true positive rate. Method Detail
* #### accuracy double accuracy() Returns accuracy. (equals to the total number of correctly classified instances out of the total number of instances.) Returns: (undocumented) * #### fMeasureByLabel double[] fMeasureByLabel(double beta) Returns f-measure for each label (category). * #### fMeasureByLabel double[] fMeasureByLabel() Returns f1-measure for each label (category). * #### falsePositiveRateByLabel double[] falsePositiveRateByLabel() Returns false positive rate for each label (category). * #### labelCol String labelCol() Field in "predictions" which gives the true label of each instance (if available). * #### labels double[] 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. Note: In most cases, it will be values {0.0, 1.0, ..., numClasses-1}, However, if the training set is missing a label, then all of the arrays over labels (e.g., from truePositiveRateByLabel) will be of length numClasses-1 instead of the expected numClasses. Returns: (undocumented) * #### precisionByLabel double[] precisionByLabel() Returns precision for each label (category). * #### predictionCol String predictionCol() Field in "predictions" which gives the prediction of each class. * #### predictions [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() Dataframe output by the model's `transform` method. Returns: (undocumented) * #### recallByLabel double[] recallByLabel() Returns recall for each label (category). * #### truePositiveRateByLabel double[] truePositiveRateByLabel() Returns true positive rate for each label (category). * #### weightCol String weightCol() Field in "predictions" which gives the weight of each instance. * #### weightedFMeasure double weightedFMeasure(double beta) Returns weighted averaged f-measure. * #### weightedFMeasure double weightedFMeasure() Returns weighted averaged f1-measure. * #### weightedFalsePositiveRate double weightedFalsePositiveRate() Returns weighted false positive rate. * #### weightedPrecision double weightedPrecision() Returns weighted averaged precision. * #### weightedRecall double weightedRecall() Returns weighted averaged recall. (equals to precision, recall and f-measure) Returns: (undocumented) * #### weightedTruePositiveRate double weightedTruePositiveRate() Returns weighted true positive rate. (equals to precision, recall and f-measure) Returns: (undocumented)