cc.mallet.cluster.neighbor_evaluator
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 a Classifier over pairs of Instances to score
Neighbor. Currently only supports AgglomerativeNeighbors.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- "Aron Culotta"
- See Also:
ClassifyingNeighborEvaluator,
Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PairwiseEvaluator
public PairwiseEvaluator(Classifier classifier,
java.lang.String scoringLabel,
PairwiseEvaluator.CombiningStrategy combiningStrategy,
boolean mergeFirst)
- Parameters:
classifier - Classifier to assign scores to Neighbors 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.
evaluate
public double[] evaluate(Neighbor[] neighbors)
- Specified by:
evaluate in interface NeighborEvaluator- Overrides:
evaluate in class ClassifyingNeighborEvaluator
- 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 interface NeighborEvaluator- Overrides:
evaluate in class ClassifyingNeighborEvaluator
- 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 interface NeighborEvaluator- Overrides:
reset in class ClassifyingNeighborEvaluator
toString
public java.lang.String toString()
- Overrides:
toString in class ClassifyingNeighborEvaluator