cc.mallet.cluster.neighbor_evaluator
Class RankingNeighborEvaluator

java.lang.Object
  extended by cc.mallet.cluster.neighbor_evaluator.ClassifyingNeighborEvaluator
      extended by cc.mallet.cluster.neighbor_evaluator.RankingNeighborEvaluator
All Implemented Interfaces:
NeighborEvaluator, java.io.Serializable

public class RankingNeighborEvaluator
extends ClassifyingNeighborEvaluator

Uses a Classifier that scores an array of Neighbors. The Classifier expects Instances with data equal to an array of Neighbors. The labeling of each Instance is a set of Integers, with labeling i corresponding the likelihood that Neighbor i is the "best" Neighbor.

Since:
1.0
Version:
1.0
Author:
"Aron Culotta"
See Also:
ClassifyingNeighborEvaluator, Serialized Form

Constructor Summary
RankingNeighborEvaluator(Classifier classifier)
           
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RankingNeighborEvaluator

public RankingNeighborEvaluator(Classifier classifier)
Parameters:
classifier - The Classifier used to assign a score to a Neighbor.
Method Detail

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.

evaluate

public double[] evaluate(Neighbor[] neighbors)
Specified by:
evaluate in interface NeighborEvaluator
Overrides:
evaluate in class ClassifyingNeighborEvaluator
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 interface NeighborEvaluator
Overrides:
reset in class ClassifyingNeighborEvaluator

toString

public java.lang.String toString()
Overrides:
toString in class ClassifyingNeighborEvaluator