Class RankingNeighborEvaluator
- java.lang.Object
-
- cc.mallet.cluster.neighbor_evaluator.ClassifyingNeighborEvaluator
-
- cc.mallet.cluster.neighbor_evaluator.RankingNeighborEvaluator
-
- All Implemented Interfaces:
NeighborEvaluator,java.io.Serializable
public class RankingNeighborEvaluator extends ClassifyingNeighborEvaluator
Uses aClassifierthat scores an array ofNeighbors. The Classifier expectsInstances with data equal to an array ofNeighbors. The labeling of each Instance is a set ofIntegers, with labeling i corresponding the likelihood thatNeighbori is the "best"Neighbor.- Since:
- 1.0
- Version:
- 1.0
- Author:
- "Aron Culotta"
- See Also:
ClassifyingNeighborEvaluator, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RankingNeighborEvaluator(Classifier classifier)
-
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
-
RankingNeighborEvaluator
public RankingNeighborEvaluator(Classifier classifier)
- Parameters:
classifier- The Classifier used to assign a score to aNeighbor.
-
-
Method Detail
-
evaluate
public double evaluate(Neighbor neighbor)
- Specified by:
evaluatein interfaceNeighborEvaluator- Overrides:
evaluatein classClassifyingNeighborEvaluator- Returns:
- A higher score indicates that the modified Clustering is preferred.
-
evaluate
public double[] evaluate(Neighbor[] neighbors)
- Specified by:
evaluatein interfaceNeighborEvaluator- Overrides:
evaluatein classClassifyingNeighborEvaluator- Parameters:
neighbors-- Returns:
- An array containing a score for each of the elements of
neighbors.
-
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
-
-