E - The type of objects being classified by the evaluated classifier.public class ConditionalClassifierEvaluator<E> extends ScoredClassifierEvaluator<E>
ConditionalClassifierEvaluator provides an evaluation
harness for conditional probability-based n-best classifiers. It
extends the scored classifier evaluator with conditional probability
specific evaluation metrics.
| Constructor and Description |
|---|
ConditionalClassifierEvaluator(ConditionalClassifier<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 |
averageConditionalProbability(String refCategory,
String responseCategory)
Returns the average conditional probability of the specified response
category for test cases with the specified reference category.
|
double |
averageConditionalProbabilityReference()
Returns the average over all test cases of the conditional
probability of the response that matches the reference
category.
|
ConditionalClassifier<E> |
classifier()
Return the classifier being evaluated.
|
ScoredPrecisionRecallEvaluation |
conditionalOneVersusAll(String refCategory)
Returns a scored precision-recall evaluation of the
classifcation of the specified reference category versus all
other categories using the conditional probability scores.
|
void |
handle(Classified<E> classified)
Add the specified classified object to this evaluator.
|
void |
setClassifier(ConditionalClassifier<E> classifier)
Set the classifier being evaluated to the specified value.
|
averageScore, averageScoreReference, scoredOneVersusAll, setClassifieraverageRank, averageRankReference, meanReciprocalRank, rankCount, setClassifieraddClassification, categories, confusionMatrix, falseNegatives, falsePositives, numCases, numCategories, oneVersusAll, setClassifier, toString, trueNegatives, truePositivespublic ConditionalClassifierEvaluator(ConditionalClassifier<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(ConditionalClassifier<E> classifier)
classifier - New classifier for this evaluation.IllegalArgumentException - If called from an evaluator with
a runtime type other than ConditionalClassifierEvaluator.public ConditionalClassifier<E> classifier()
classifier in class ScoredClassifierEvaluator<E>public void handle(Classified<E> classified)
BaseClassifierEvaluatorhandle in interface ObjectHandler<Classified<E>>handle in class ScoredClassifierEvaluator<E>classified - Classified object to add to evaluation.public double averageConditionalProbability(String refCategory, String responseCategory)
Double.NaN. If the conditional classifiers'
results are properly normalized, the sum of the averages over
all categories will be 1.0.
Better classifiers return high values when the reference and response categories are the same and lower values when they are different. The log value would be extremely volatile given the extremely low and high conditional estimates of the language model classifiers.
refCategory - Reference category.responseCategory - Response category.IllegalArgumentException - If the either category is unknown.public double averageConditionalProbabilityReference()
As a normalized value, the average conditional probability always has a sensible interpretation across training instances.
public ScoredPrecisionRecallEvaluation conditionalOneVersusAll(String refCategory)
refCategory - Reference category.IllegalArgumentException - If the specified category
is unknown.Copyright © 2016 Alias-i, Inc.. All rights reserved.