org.carrot2.output.metrics
Class PrecisionRecallMetric

java.lang.Object
  extended by org.carrot2.output.metrics.PrecisionRecallMetric
All Implemented Interfaces:
IClusteringMetric

public class PrecisionRecallMetric
extends Object

Computes precision, recall and F-metric for all partitions against the provided clusters.

Metrics will be calculated only if all input documents have non-blank Document.PARTITIONS.


Field Summary
static String BEST_F_MEASURE_PARTITION
          Partition on which the cluster achieved best F-Score value.
 List<Cluster> clusters
           
 List<Document> documents
           
 boolean enabled
          Calculate F-measure.
 Map<Object,Double> fMeasureByPartition
          F-measure by partition.
 String partitionIdFieldName
          Partition id field name.
 Map<Object,Double> precisionByPartition
          Precision by partition.
 Map<Object,Double> recallByPartition
          Recall by partition.
 Double weightedAverageFMeasure
          Average F-measure of the whole cluster set, weighted by cluster size.
 Double weightedAveragePrecision
          Average precision of the whole cluster set, weighted by cluster size.
 Double weightedAverageRecall
          Average recall of the whole cluster set, weighted by cluster size.
 
Constructor Summary
PrecisionRecallMetric()
           
 
Method Summary
 void calculate()
          Triggers calculation of the metric.
 boolean isEnabled()
          Return true if this metric should be calculated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEST_F_MEASURE_PARTITION

public static final String BEST_F_MEASURE_PARTITION
Partition on which the cluster achieved best F-Score value. Value type: Object. See Document.PARTITIONS for more information.

See Also:
Constant Field Values

weightedAveragePrecision

public Double weightedAveragePrecision
Average precision of the whole cluster set, weighted by cluster size.


weightedAverageRecall

public Double weightedAverageRecall
Average recall of the whole cluster set, weighted by cluster size.


weightedAverageFMeasure

public Double weightedAverageFMeasure
Average F-measure of the whole cluster set, weighted by cluster size.


precisionByPartition

public Map<Object,Double> precisionByPartition
Precision by partition.


recallByPartition

public Map<Object,Double> recallByPartition
Recall by partition.


fMeasureByPartition

public Map<Object,Double> fMeasureByPartition
F-measure by partition.


enabled

public boolean enabled
Calculate F-measure.


documents

public List<Document> documents

clusters

public List<Cluster> clusters

partitionIdFieldName

public String partitionIdFieldName
Partition id field name.

Constructor Detail

PrecisionRecallMetric

public PrecisionRecallMetric()
Method Detail

calculate

public void calculate()
Description copied from interface: IClusteringMetric
Triggers calculation of the metric. All Processing Input attributes will have been bound before a call to this method.


isEnabled

public boolean isEnabled()
Description copied from interface: IClusteringMetric
Return true if this metric should be calculated.



Copyright (c) Dawid Weiss, Stanislaw Osinski