|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aliasi.classify.BaseClassifierEvaluator<E>
com.aliasi.classify.RankedClassifierEvaluator<E>
com.aliasi.classify.ScoredClassifierEvaluator<E>
E - The type of objects being classified by the evaluated classifier.public class ScoredClassifierEvaluator<E>
A ScoredClassifierEvaluator provides an evaluation harness for
score-based classifiers. It extends the ranked classifier evaluator with
score-specific evaluation metrics.
| Constructor Summary | |
|---|---|
ScoredClassifierEvaluator(ScoredClassifier<E> classifier,
String[] categories,
boolean storeInputs)
Construct a scored classifier evaluator with the specified classifier, categories and flag indicating whether or not to store inputs. |
|
| Method Summary | |
|---|---|
double |
averageScore(String refCategory,
String responseCategory)
Returns the average score of the specified response category for test cases with the specified reference category. |
double |
averageScoreReference()
Returns the average over all test cases of the score of the response that matches the reference category. |
ScoredClassifier<E> |
classifier()
Return the classifier being evaluated. |
void |
handle(Classified<E> classified)
Add the specified classified object to this evaluator. |
ScoredPrecisionRecallEvaluation |
scoredOneVersusAll(String refCategory)
Returns a scored precision-recall evaluation of the classification of the specified reference category versus all other categories using the classification scores. |
void |
setClassifier(ScoredClassifier<E> classifier)
Set the classifier being evaluated to the specified value. |
| Methods inherited from class com.aliasi.classify.RankedClassifierEvaluator |
|---|
averageRank, averageRankReference, meanReciprocalRank, rankCount, setClassifier |
| Methods inherited from class com.aliasi.classify.BaseClassifierEvaluator |
|---|
addClassification, categories, confusionMatrix, falseNegatives, falsePositives, numCases, numCategories, oneVersusAll, setClassifier, toString, trueNegatives, truePositives |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ScoredClassifierEvaluator(ScoredClassifier<E> classifier,
String[] categories,
boolean storeInputs)
classifier - Classifier to evaluate.categories - Complete list of categories.storeInputs - Set to true to store input objects.| Method Detail |
|---|
public void setClassifier(ScoredClassifier<E> classifier)
classifier - New classifier for this evaluation.
IllegalArgumentException - If called from an evaluator with
a runtime type other than ScoredClassifierEvaluator.public ScoredClassifier<E> classifier()
classifier in class RankedClassifierEvaluator<E>public void handle(Classified<E> classified)
BaseClassifierEvaluator
handle in interface ObjectHandler<Classified<E>>handle in class RankedClassifierEvaluator<E>classified - Classified object to add to evaluation.public ScoredPrecisionRecallEvaluation scoredOneVersusAll(String refCategory)
refCategory - Reference category.
IllegalArgumentException - If the specified category
is unknown.
public double averageScore(String refCategory,
String responseCategory)
Double.NaN.
Better classifiers return high values when the reference and response categories are the same and lower values when they are different. Depending on the classifier, the scores may or may not be meaningful as an average.
refCategory - Reference category.responseCategory - Response category.
IllegalArgumentException - If the either category is unknown.public double averageScoreReference()
Whether average scores make sense across training instances depends on the classifier.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||