Class MultilabelMetrics
Object
org.apache.spark.mllib.evaluation.MultilabelMetrics
Evaluator for multilabel classification.
param: predictionAndLabels an RDD of (predictions, labels) pairs,
both are non-null Arrays, each with unique elements.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
accuracy()
Returns accuracydouble
Returns document-based f1-measure averaged by the number of documentsdouble
f1Measure
(double label) Returns f1-measure for a given label (category)double
Returns Hamming-lossdouble[]
labels()
double
double
double
double
Returns document-based precision averaged by the number of documentsdouble
precision
(double label) Returns precision for a given label (category)double
recall()
Returns document-based recall averaged by the number of documentsdouble
recall
(double label) Returns recall for a given label (category)double
Returns subset accuracy (for equal sets of labels)
-
Constructor Details
-
MultilabelMetrics
-
-
Method Details
-
accuracy
public double accuracy()Returns accuracy- Returns:
- (undocumented)
-
f1Measure
public double f1Measure()Returns document-based f1-measure averaged by the number of documents- Returns:
- (undocumented)
-
f1Measure
public double f1Measure(double label) Returns f1-measure for a given label (category)- Parameters:
label
- the label.- Returns:
- (undocumented)
-
hammingLoss
public double hammingLoss()Returns Hamming-loss- Returns:
- (undocumented)
-
labels
public double[] labels() -
microF1Measure
public double microF1Measure() -
microPrecision
public double microPrecision() -
microRecall
public double microRecall() -
precision
public double precision()Returns document-based precision averaged by the number of documents- Returns:
- (undocumented)
-
precision
public double precision(double label) Returns precision for a given label (category)- Parameters:
label
- the label.- Returns:
- (undocumented)
-
recall
public double recall()Returns document-based recall averaged by the number of documents- Returns:
- (undocumented)
-
recall
public double recall(double label) Returns recall for a given label (category)- Parameters:
label
- the label.- Returns:
- (undocumented)
-
subsetAccuracy
public double subsetAccuracy()Returns subset accuracy (for equal sets of labels)- Returns:
- (undocumented)
-