public class MulticlassMetrics
extends Object
param: predictionAndLabels an RDD of (prediction, label) pairs.
Constructor and Description |
---|
MulticlassMetrics(RDD<scala.Tuple2<Object,Object>> predictionAndLabels) |
Modifier and Type | Method and Description |
---|---|
double |
accuracy()
Returns accuracy
(equals to the total number of correctly classified instances
out of the total number of instances.)
|
Matrix |
confusionMatrix()
Returns confusion matrix:
predicted classes are in columns,
they are ordered by class label ascending,
as in "labels"
|
double |
falsePositiveRate(double label)
Returns false positive rate for a given label (category)
|
double |
fMeasure()
Deprecated.
Use accuracy. Since 2.0.0.
|
double |
fMeasure(double label)
Returns f1-measure for a given label (category)
|
double |
fMeasure(double label,
double beta)
Returns f-measure for a given label (category)
|
double[] |
labels()
Returns the sequence of labels in ascending order
|
double |
precision()
Deprecated.
Use accuracy. Since 2.0.0.
|
double |
precision(double label)
Returns precision for a given label (category)
|
double |
recall()
Deprecated.
Use accuracy. Since 2.0.0.
|
double |
recall(double label)
Returns recall for a given label (category)
|
double |
truePositiveRate(double label)
Returns true positive rate for a given label (category)
|
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
(equals to precision, recall and f-measure)
|
double |
weightedTruePositiveRate()
Returns weighted true positive rate
(equals to precision, recall and f-measure)
|
public MulticlassMetrics(RDD<scala.Tuple2<Object,Object>> predictionAndLabels)
public Matrix confusionMatrix()
public double truePositiveRate(double label)
label
- the label.public double falsePositiveRate(double label)
label
- the label.public double precision(double label)
label
- the label.public double recall(double label)
label
- the label.public double fMeasure(double label, double beta)
label
- the label.beta
- the beta parameter.public double fMeasure(double label)
label
- the label.public double precision()
public double recall()
public double fMeasure()
public double accuracy()
public double weightedTruePositiveRate()
public double weightedFalsePositiveRate()
public double weightedRecall()
public double weightedPrecision()
public double weightedFMeasure(double beta)
beta
- the beta parameter.public double weightedFMeasure()
public double[] labels()