Class MulticlassMetrics
Object
org.apache.spark.mllib.evaluation.MulticlassMetrics
Evaluator for multiclass classification.
 
param: predictionAndLabels an RDD of (prediction, label, weight, probability) or (prediction, label, weight) or (prediction, label) tuples.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiondoubleaccuracy()Returns confusion matrix: predicted classes are in columns, they are ordered by class label ascending, as in "labels"doublefalsePositiveRate(double label) Returns false positive rate for a given label (category)doublefMeasure(double label) Returns f1-measure for a given label (category)doublefMeasure(double label, double beta) Returns f-measure for a given label (category)doubledouble[]labels()doublelogLoss(double eps) Returns the log-loss, aka logistic loss or cross-entropy loss.doubleprecision(double label) Returns precision for a given label (category)doublerecall(double label) Returns recall for a given label (category)doubletruePositiveRate(double label) Returns true positive rate for a given label (category)doubledoubledoubleweightedFMeasure(double beta) Returns weighted averaged f-measuredoubledoubledouble
- 
Constructor Details- 
MulticlassMetrics
 
- 
- 
Method Details- 
accuracypublic double accuracy()
- 
confusionMatrixReturns confusion matrix: predicted classes are in columns, they are ordered by class label ascending, as in "labels"- Returns:
- (undocumented)
 
- 
fMeasurepublic double fMeasure(double label, double beta) Returns f-measure for a given label (category)- Parameters:
- label- the label.
- beta- the beta parameter.
- Returns:
- (undocumented)
 
- 
fMeasurepublic double fMeasure(double label) Returns f1-measure for a given label (category)- Parameters:
- label- the label.
- Returns:
- (undocumented)
 
- 
falsePositiveRatepublic double falsePositiveRate(double label) Returns false positive rate for a given label (category)- Parameters:
- label- the label.
- Returns:
- (undocumented)
 
- 
hammingLosspublic double hammingLoss()
- 
labelspublic double[] labels()
- 
logLosspublic double logLoss(double eps) Returns the log-loss, aka logistic loss or cross-entropy loss.- Parameters:
- eps- log-loss is undefined for p=0 or p=1, so probabilities are clipped to max(eps, min(1 - eps, p)).
- Returns:
- (undocumented)
 
- 
precisionpublic double precision(double label) Returns precision for a given label (category)- Parameters:
- label- the label.
- Returns:
- (undocumented)
 
- 
recallpublic double recall(double label) Returns recall for a given label (category)- Parameters:
- label- the label.
- Returns:
- (undocumented)
 
- 
truePositiveRatepublic double truePositiveRate(double label) Returns true positive rate for a given label (category)- Parameters:
- label- the label.
- Returns:
- (undocumented)
 
- 
weightedFMeasurepublic double weightedFMeasure(double beta) Returns weighted averaged f-measure- Parameters:
- beta- the beta parameter.
- Returns:
- (undocumented)
 
- 
weightedFMeasurepublic double weightedFMeasure()
- 
weightedFalsePositiveRatepublic double weightedFalsePositiveRate()
- 
weightedPrecisionpublic double weightedPrecision()
- 
weightedRecallpublic double weightedRecall()
- 
weightedTruePositiveRatepublic double weightedTruePositiveRate()
 
-