Class ClassifyingNeighborEvaluator
- java.lang.Object
-
- cc.mallet.cluster.neighbor_evaluator.ClassifyingNeighborEvaluator
-
- All Implemented Interfaces:
NeighborEvaluator
,java.io.Serializable
- Direct Known Subclasses:
MedoidEvaluator
,PairwiseEvaluator
,RankingNeighborEvaluator
public class ClassifyingNeighborEvaluator extends java.lang.Object implements NeighborEvaluator, java.io.Serializable
ANeighborEvaluator
that is backed by aClassifier
. The score for aNeighbor
is the Classifier's predicted value for the label corresponding toscoringLabel
.- Since:
- 1.0
- Version:
- 1.0
- Author:
- "Aron Culotta"
- See Also:
NeighborEvaluator
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ClassifyingNeighborEvaluator(Classifier classifier, java.lang.String scoringLabel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
evaluate(Neighbor neighbor)
double[]
evaluate(Neighbor[] neighbors)
Classifier
getClassifier()
void
reset()
Reset the state of the evaluator.java.lang.String
toString()
-
-
-
Constructor Detail
-
ClassifyingNeighborEvaluator
public ClassifyingNeighborEvaluator(Classifier classifier, java.lang.String scoringLabel)
- Parameters:
classifier
- The Classifier used to assign a score to eachNeighbor
.scoringLabel
- The label corresponding to a positive instance (e.g. "YES").
-
-
Method Detail
-
getClassifier
public Classifier getClassifier()
- Returns:
- The classifier.
-
evaluate
public double evaluate(Neighbor neighbor)
- Specified by:
evaluate
in interfaceNeighborEvaluator
- Returns:
- A higher score indicates that the modified Clustering is preferred.
-
evaluate
public double[] evaluate(Neighbor[] neighbors)
- Specified by:
evaluate
in interfaceNeighborEvaluator
- Returns:
- One score per neighbor. 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
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-