Class MultilabelMetrics

Object
org.apache.spark.mllib.evaluation.MultilabelMetrics

public class MultilabelMetrics extends Object
Evaluator for multilabel classification. param: predictionAndLabels an RDD of (predictions, labels) pairs, both are non-null Arrays, each with unique elements.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MultilabelMetrics(RDD<scala.Tuple2<double[],double[]>> predictionAndLabels)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns accuracy
    double
    Returns document-based f1-measure averaged by the number of documents
    double
    f1Measure(double label)
    Returns f1-measure for a given label (category)
    double
    Returns Hamming-loss
    double[]
     
    double
     
    double
     
    double
     
    double
    Returns document-based precision averaged by the number of documents
    double
    precision(double label)
    Returns precision for a given label (category)
    double
    Returns document-based recall averaged by the number of documents
    double
    recall(double label)
    Returns recall for a given label (category)
    double
    Returns subset accuracy (for equal sets of labels)

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MultilabelMetrics

      public MultilabelMetrics(RDD<scala.Tuple2<double[],double[]>> predictionAndLabels)
  • 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)