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 aClassifier
over pairs ofInstances
to scoreNeighbor
. Currently only supportsAgglomerativeNeighbor
s.- 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 class
PairwiseEvaluator.Average
static interface
PairwiseEvaluator.CombiningStrategy
Specifies how to combine a set of pairwise scores into a cluster-wise score.static class
PairwiseEvaluator.Maximum
static class
PairwiseEvaluator.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 double
evaluate(Neighbor neighbor)
double[]
evaluate(Neighbor[] neighbors)
void
reset()
Reset the state of the evaluator.java.lang.String
toString()
-
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 toNeighbor
s 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:
evaluate
in interfaceNeighborEvaluator
- Overrides:
evaluate
in classClassifyingNeighborEvaluator
- Returns:
- One score per neighbor. A higher score indicates that the modified Clustering is preferred.
-
evaluate
public double evaluate(Neighbor neighbor)
- Specified by:
evaluate
in interfaceNeighborEvaluator
- Overrides:
evaluate
in classClassifyingNeighborEvaluator
- Returns:
- A higher score indicates that the modified Clustering is preferred.
-
reset
public void reset()
Description copied from interface:NeighborEvaluator
Reset the state of the evaluator.- Specified by:
reset
in interfaceNeighborEvaluator
- Overrides:
reset
in classClassifyingNeighborEvaluator
-
toString
public java.lang.String toString()
- Overrides:
toString
in classClassifyingNeighborEvaluator
-
-