E - The type of objects being classified by the evaluated classifier.public class JointClassifierEvaluator<E> extends ConditionalClassifierEvaluator<E>
JointClassifierEvaluator provides an evaluation harness
for joint probability-based n-best classifiers. It extends the
conditional classifier evaluator with joint probability specific
evaluation metrics.
| Constructor and Description |
|---|
JointClassifierEvaluator(JointClassifier<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 |
averageLog2JointProbability(String refCategory,
String responseCategory)
Returns the average log (base 2) joint probability of the
response category for cases of the specified reference
category.
|
double |
averageLog2JointProbabilityReference()
Returns the average over all test cases of the joint log (base
2) probability of the response that matches the reference
category.
|
JointClassifier<E> |
classifier()
Return the classifier being evaluated.
|
double |
corpusLog2JointProbability()
Returns the joint log (base 2) probability of the entire
evaluation corpus.
|
void |
setClassifier(JointClassifier<E> classifier)
Set the classifier being evaluated to the specified value.
|
averageConditionalProbability, averageConditionalProbabilityReference, conditionalOneVersusAll, handle, setClassifieraverageScore, averageScoreReference, scoredOneVersusAll, setClassifieraverageRank, averageRankReference, meanReciprocalRank, rankCount, setClassifieraddClassification, categories, confusionMatrix, falseNegatives, falsePositives, numCases, numCategories, oneVersusAll, setClassifier, toString, trueNegatives, truePositivespublic JointClassifierEvaluator(JointClassifier<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(JointClassifier<E> classifier)
classifier - New classifier for this evaluation.IllegalArgumentException - If called from an evaluator with
a runtime type other than JointClassifierEvaluator.public JointClassifier<E> classifier()
classifier in class ConditionalClassifierEvaluator<E>public double averageLog2JointProbability(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. Unlike the conditional probability values, joint probability averages are not particularly useful because they are not normalized by input length. For the language model classifiers, the scores are normalized by length, and provide a better cross-case view.
refCategory - Reference category.responseCategory - Response category.IllegalArgumentException - If the either category is unknown.ClassCastException - if the classifications are not joint
classifications.public double averageLog2JointProbabilityReference()
Whether average scores make sense across training instances depends on the classifier. For the language-model based classifiers, the normalized score values are more reasonable averages.
public double corpusLog2JointProbability()
x:
log2 p(corpus)
= Σx in corpus log2 p(x)
where the probability p(x) for a single case with
input x is defined in the usual way by summing
over categories:
p(x) = Σc in cats p(c,x)
ClassCastException - if the classifications are not joint
classifications.Copyright © 2019 Alias-i, Inc.. All rights reserved.