|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.apache.spark.mllib.evaluation.MulticlassMetrics
public class MulticlassMetrics
::Experimental:: Evaluator for multiclass classification.
param: predictionAndLabels an RDD of (prediction, label) pairs.
Constructor Summary | |
---|---|
MulticlassMetrics(RDD<scala.Tuple2<Object,Object>> predictionAndLabels)
|
Method Summary | |
---|---|
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()
Returns f-measure (equals to precision and recall because precision equals recall) |
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()
Returns precision |
double |
precision(double label)
Returns precision for a given label (category) |
double |
recall()
Returns recall (equals to precision for multiclass classifier because sum of all false positives is equal to sum of all false negatives) |
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) |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MulticlassMetrics(RDD<scala.Tuple2<Object,Object>> predictionAndLabels)
Method Detail |
---|
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 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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |