Class PairwiseEvaluator
- java.lang.Object
-
- cc.mallet.cluster.neighbor_evaluator.ClassifyingNeighborEvaluator
-
- cc.mallet.cluster.neighbor_evaluator.PairwiseEvaluator
-
- All Implemented Interfaces:
NeighborEvaluator,java.io.Serializable
public class PairwiseEvaluator extends ClassifyingNeighborEvaluator
Uses aClassifierover pairs ofInstancesto scoreNeighbor. Currently only supportsAgglomerativeNeighbors.- Since:
- 1.0
- Version:
- 1.0
- Author:
- "Aron Culotta"
- See Also:
ClassifyingNeighborEvaluator, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPairwiseEvaluator.Averagestatic interfacePairwiseEvaluator.CombiningStrategySpecifies how to combine a set of pairwise scores into a cluster-wise score.static classPairwiseEvaluator.Maximumstatic classPairwiseEvaluator.Minimum
-
Constructor Summary
Constructors Constructor Description PairwiseEvaluator(Classifier classifier, java.lang.String scoringLabel, PairwiseEvaluator.CombiningStrategy combiningStrategy, boolean mergeFirst)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleevaluate(Neighbor neighbor)double[]evaluate(Neighbor[] neighbors)voidreset()Reset the state of the evaluator.java.lang.StringtoString()-
Methods inherited from class cc.mallet.cluster.neighbor_evaluator.ClassifyingNeighborEvaluator
getClassifier
-
-
-
-
Constructor Detail
-
PairwiseEvaluator
public PairwiseEvaluator(Classifier classifier, java.lang.String scoringLabel, PairwiseEvaluator.CombiningStrategy combiningStrategy, boolean mergeFirst)
- Parameters:
classifier- Classifier to assign scores toNeighbors for which a pair of Instances has been merged.scoringLabel- The predicted label that corresponds to a positive example (e.g. "YES").combiningStrategy- How to combine the pairwise scores (e.g. max, mean, ...).mergeFirst- If true, score all edges involved in a merge. If false, only score the edges that cross the boundaries of the clusters being merged.
-
-
Method Detail
-
evaluate
public double[] evaluate(Neighbor[] neighbors)
- Specified by:
evaluatein interfaceNeighborEvaluator- Overrides:
evaluatein classClassifyingNeighborEvaluator- Returns:
- One score per neighbor. A higher score indicates that the modified Clustering is preferred.
-
evaluate
public double evaluate(Neighbor neighbor)
- Specified by:
evaluatein interfaceNeighborEvaluator- Overrides:
evaluatein classClassifyingNeighborEvaluator- Returns:
- A higher score indicates that the modified Clustering is preferred.
-
reset
public void reset()
Description copied from interface:NeighborEvaluatorReset the state of the evaluator.- Specified by:
resetin interfaceNeighborEvaluator- Overrides:
resetin classClassifyingNeighborEvaluator
-
toString
public java.lang.String toString()
- Overrides:
toStringin classClassifyingNeighborEvaluator
-
-