Package cc.mallet.fst.confidence
Class ConfidenceEvaluator
- java.lang.Object
-
- cc.mallet.fst.confidence.ConfidenceEvaluator
-
public class ConfidenceEvaluator extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConfidenceEvaluator.EntityConfidencea simple class to store a confidence score and whether or not this labeling is correct
-
Constructor Summary
Constructors Constructor Description ConfidenceEvaluator(InstanceWithConfidence[] instances, boolean sorted)ConfidenceEvaluator(PipedInstanceWithConfidence[] instances, boolean sorted)ConfidenceEvaluator(Segment[] segments, boolean sorted)ConfidenceEvaluator(java.util.Vector confidences)ConfidenceEvaluator(java.util.Vector confidences, int nBins)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleaccuracyAtCoverage(double cov)java.lang.StringaccuracyCoverageValuesToString()java.lang.StringaccuracyRecallValuesToString(int totalTrue)doublecorrelation()Calculate pearson's R for the corellation between confidence and correct, where 1 = correct and -1 = incorrectdouble[]getAccuracyCoverageValues()get accuracy at coverage for each bin of valuesdouble[][]getAccuracyRecallValues(int totalTrue)get accuracy at recall for each bin of valuesdoublegetAverageAccuracy()doublegetAverageCorrectConfidence()Average confidence score for the incorrect entitiesdoublegetAverageIncorrectConfidence()Average confidence score for the incorrect entitiesdoublegetAveragePrecision()IR Average precision measure.doublegetConfidenceMean()doublegetConfidenceStandardDeviation()Standard deviation of confidence scoresdoublegetConfidenceSum()doublegetWorstAveragePrecision()For comparison, rank segments as badly as possible (all "incorrect" before "correct").intnumCorrect()intnumCorrectAtCoverage(double cov)doublepointBiserialCorrelation()Correlation when one variable (X) is binary: r = (bar(x1) - bar(x0)) * sqrt(p(1-p)) / sx , where bar(x1) = mean of X when Y is 1 bar(x0) = mean of X when Y is 0 sx = standard deviation of X p = proportion of values where Y=1intsize()java.lang.StringtoString()
-
-
-
Constructor Detail
-
ConfidenceEvaluator
public ConfidenceEvaluator(java.util.Vector confidences, int nBins)
-
ConfidenceEvaluator
public ConfidenceEvaluator(java.util.Vector confidences)
-
ConfidenceEvaluator
public ConfidenceEvaluator(Segment[] segments, boolean sorted)
-
ConfidenceEvaluator
public ConfidenceEvaluator(InstanceWithConfidence[] instances, boolean sorted)
-
ConfidenceEvaluator
public ConfidenceEvaluator(PipedInstanceWithConfidence[] instances, boolean sorted)
-
-
Method Detail
-
pointBiserialCorrelation
public double pointBiserialCorrelation()
Correlation when one variable (X) is binary: r = (bar(x1) - bar(x0)) * sqrt(p(1-p)) / sx , where bar(x1) = mean of X when Y is 1 bar(x0) = mean of X when Y is 0 sx = standard deviation of X p = proportion of values where Y=1
-
getAveragePrecision
public double getAveragePrecision()
IR Average precision measure. Analogous to ranking _correct_ documents by confidence score.
-
getWorstAveragePrecision
public double getWorstAveragePrecision()
For comparison, rank segments as badly as possible (all "incorrect" before "correct").
-
getConfidenceSum
public double getConfidenceSum()
-
getConfidenceMean
public double getConfidenceMean()
-
getConfidenceStandardDeviation
public double getConfidenceStandardDeviation()
Standard deviation of confidence scores
-
correlation
public double correlation()
Calculate pearson's R for the corellation between confidence and correct, where 1 = correct and -1 = incorrect
-
getAccuracyCoverageValues
public double[] getAccuracyCoverageValues()
get accuracy at coverage for each bin of values
-
accuracyCoverageValuesToString
public java.lang.String accuracyCoverageValuesToString()
-
getAccuracyRecallValues
public double[][] getAccuracyRecallValues(int totalTrue)
get accuracy at recall for each bin of values- Parameters:
totalTrue- total number of true Segments- Returns:
- 2-d array where values[i][0] is coverage and values[i][1] is accuracy at position i.
-
accuracyRecallValuesToString
public java.lang.String accuracyRecallValuesToString(int totalTrue)
-
accuracyAtCoverage
public double accuracyAtCoverage(double cov)
-
numCorrectAtCoverage
public int numCorrectAtCoverage(double cov)
-
getAverageAccuracy
public double getAverageAccuracy()
-
numCorrect
public int numCorrect()
-
getAverageIncorrectConfidence
public double getAverageIncorrectConfidence()
Average confidence score for the incorrect entities
-
getAverageCorrectConfidence
public double getAverageCorrectConfidence()
Average confidence score for the incorrect entities
-
size
public int size()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-