Package org.nlpub.watset.eval
Class CachedNormalizedModifiedPurity<V>
- java.lang.Object
-
- org.nlpub.watset.eval.NormalizedModifiedPurity<V>
-
- org.nlpub.watset.eval.CachedNormalizedModifiedPurity<V>
-
public class CachedNormalizedModifiedPurity<V> extends NormalizedModifiedPurity<V>
Cached normalized modified purity evaluation measure for overlapping clustering.This class creates an instance of
ConcurrentHashMapto cache the cluster element scores. It is designed under assumption that theclassesdo not change. This assumption is valid for computing the precision (nmPU) in case of normalized modified purity as defined by Kawahara et al. (ACL 2014).Since the underlying data structure has no size limit, this class is memory-greedy. Please make sure that you have tuned the JVM heap size when using it.
- See Also:
NormalizedModifiedPurity
-
-
Constructor Summary
Constructors Constructor Description CachedNormalizedModifiedPurity()Construct a cached normalized modified purity calculator.CachedNormalizedModifiedPurity(boolean normalized, boolean modified)Construct a cached normalized modified purity calculator that allows turning normalized and/or modified options off.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublescore(Map<V,Double> cluster, Collection<Map<V,Double>> classes)Compute the (modified) cluster score on a defined collection of classes.
-
-
-
Constructor Detail
-
CachedNormalizedModifiedPurity
public CachedNormalizedModifiedPurity()
Construct a cached normalized modified purity calculator.
-
CachedNormalizedModifiedPurity
public CachedNormalizedModifiedPurity(boolean normalized, boolean modified)Construct a cached normalized modified purity calculator that allows turning normalized and/or modified options off.- Parameters:
normalized- normalized purity is onmodified- modified purity is on
-
-
Method Detail
-
score
public double score(Map<V,Double> cluster, Collection<Map<V,Double>> classes)
Description copied from class:NormalizedModifiedPurityCompute the (modified) cluster score on a defined collection of classes.- Overrides:
scorein classNormalizedModifiedPurity<V>- Parameters:
cluster- the cluster to evaluateclasses- the collection of the gold standard clusters- Returns:
- cluster score
-
-