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 aClassifier
that scores an array ofNeighbor
s. The Classifier expectsInstance
s with data equal to an array ofNeighbor
s. The labeling of each Instance is a set ofInteger
s, with labeling i corresponding the likelihood thatNeighbor
i 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 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
-
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:
evaluate
in interfaceNeighborEvaluator
- Overrides:
evaluate
in classClassifyingNeighborEvaluator
- Returns:
- A higher score indicates that the modified Clustering is preferred.
-
evaluate
public double[] evaluate(Neighbor[] neighbors)
- Specified by:
evaluate
in interfaceNeighborEvaluator
- Overrides:
evaluate
in classClassifyingNeighborEvaluator
- Parameters:
neighbors
-- Returns:
- An array containing a score for each of the elements of
neighbors
.
-
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
-
-