public class MultiClassPrecisionRecallExtendedStats<L> extends MultiClassPrecisionRecallStats<L>
Modifier and Type | Class and Description |
---|---|
static class |
MultiClassPrecisionRecallExtendedStats.MultiClassStringLabelStats |
static class |
MultiClassPrecisionRecallExtendedStats.StringStringConverter |
Modifier and Type | Field and Description |
---|---|
protected IntCounter<L> |
correctGuesses |
protected IntCounter<L> |
foundCorrect |
protected IntCounter<L> |
foundGuessed |
protected int |
noLabel |
protected java.util.function.Function<java.lang.String,L> |
stringConverter |
protected int |
tokensCorrect |
protected int |
tokensCount |
fnCount, fpCount, labelIndex, negIndex, negLabel, tpCount
Constructor and Description |
---|
MultiClassPrecisionRecallExtendedStats(Classifier<L,F> classifier,
GeneralDataset<L,F> data,
L negLabel) |
MultiClassPrecisionRecallExtendedStats(Index<L> dataLabelIndex,
L negLabel) |
MultiClassPrecisionRecallExtendedStats(L negLabel) |
Modifier and Type | Method and Description |
---|---|
protected void |
addGuess(L guess,
L label) |
protected void |
addGuess(L guess,
L label,
boolean addUnknownLabels) |
void |
addGuesses(java.util.List<L> guesses,
java.util.List<L> trueLabels) |
void |
clearCounts() |
protected void |
finalizeCounts() |
double |
getAccuracy() |
java.lang.String |
getAccuracyDescription(int numDigits)
Returns a String summarizing overall accuracy that will print nicely.
|
Triple<java.lang.Double,java.lang.Integer,java.lang.Integer> |
getAccuracyInfo()
Return overall per token accuracy
|
java.lang.String |
getConllEvalString() |
java.lang.String |
getConllEvalString(boolean ignoreNegLabel) |
int |
getCorrect()
Return overall number of correct answers
|
int |
getCorrect(L label) |
java.util.List<L> |
getLabels() |
int |
getRelevant() |
int |
getRelevant(L label) |
int |
getRetrieved() |
int |
getRetrieved(L label) |
protected void |
markBoundary() |
double |
score() |
double |
score(java.io.BufferedReader br,
java.lang.String delimiter) |
double |
score(java.io.BufferedReader br,
java.lang.String delimiter,
java.lang.String boundary) |
<F> double |
score(Classifier<L,F> classifier,
GeneralDataset<L,F> data) |
double |
score(java.util.List<L> guesses,
java.util.List<L> trueLabels)
Returns the score (F1) for the given list of guesses
|
double |
score(java.util.List<L> guesses,
java.util.List<L> trueLabels,
Index<L> dataLabelIndex)
Returns the score (F1) for the given list of guesses
|
double |
score(java.lang.String filename,
java.lang.String delimiter) |
double |
score(java.lang.String filename,
java.lang.String delimiter,
java.lang.String boundary) |
void |
setLabelIndex(Index<L> dataLabelIndex) |
getDescription, getF1Description, getF1Description, getFMeasure, getFMeasure, getNegLabel, getPrecision, getPrecision, getPrecisionDescription, getPrecisionDescription, getPrecisionInfo, getPrecisionInfo, getRecall, getRecall, getRecallDescription, getRecallDescription, getRecallInfo, getRecallInfo, score
protected IntCounter<L> correctGuesses
protected IntCounter<L> foundCorrect
protected IntCounter<L> foundGuessed
protected int tokensCount
protected int tokensCorrect
protected int noLabel
protected java.util.function.Function<java.lang.String,L> stringConverter
public MultiClassPrecisionRecallExtendedStats(Classifier<L,F> classifier, GeneralDataset<L,F> data, L negLabel)
public MultiClassPrecisionRecallExtendedStats(L negLabel)
public <F> double score(Classifier<L,F> classifier, GeneralDataset<L,F> data)
score
in class MultiClassPrecisionRecallStats<L>
public double score(java.util.List<L> guesses, java.util.List<L> trueLabels, Index<L> dataLabelIndex)
guesses
- - Guesses by classifiertrueLabels
- - Gold labels to compare guesses againstdataLabelIndex
- - Index of labelspublic double score(java.util.List<L> guesses, java.util.List<L> trueLabels)
guesses
- - Guesses by classifiertrueLabels
- - Gold labels to compare guesses againstpublic double score()
public void clearCounts()
protected void finalizeCounts()
protected void markBoundary()
public int getCorrect()
public int getCorrect(L label)
public int getRetrieved(L label)
public int getRetrieved()
public int getRelevant(L label)
public int getRelevant()
public Triple<java.lang.Double,java.lang.Integer,java.lang.Integer> getAccuracyInfo()
public double getAccuracy()
public java.lang.String getAccuracyDescription(int numDigits)
public double score(java.lang.String filename, java.lang.String delimiter) throws java.io.IOException
java.io.IOException
public double score(java.lang.String filename, java.lang.String delimiter, java.lang.String boundary) throws java.io.IOException
java.io.IOException
public double score(java.io.BufferedReader br, java.lang.String delimiter) throws java.io.IOException
java.io.IOException
public double score(java.io.BufferedReader br, java.lang.String delimiter, java.lang.String boundary) throws java.io.IOException
java.io.IOException
public java.util.List<L> getLabels()
public java.lang.String getConllEvalString()
public java.lang.String getConllEvalString(boolean ignoreNegLabel)