E - The type of objects being classified by the evaluated classifier.public class ScoredClassifierEvaluator<E> extends RankedClassifierEvaluator<E>
ScoredClassifierEvaluator provides an evaluation harness for
score-based classifiers. It extends the ranked classifier evaluator with
score-specific evaluation metrics.
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
averageRank, averageRankReference, meanReciprocalRank, rankCount, setClassifieraddClassification, categories, confusionMatrix, falseNegatives, falsePositives, numCases, numCategories, oneVersusAll, setClassifier, toString, trueNegatives, truePositivespublic 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.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)
BaseClassifierEvaluatorhandle 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.
Copyright © 2016 Alias-i, Inc.. All rights reserved.