public class PrecisionRecallStats extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
fnCount
Count of false negatives.
|
protected int |
fpCount
Count of false positives.
|
protected int |
tpCount
Count of true positives.
|
Constructor and Description |
---|
PrecisionRecallStats()
Constructs a new PrecisionRecallStats with initially 0 counts.
|
PrecisionRecallStats(Classifier<L,F> classifier,
Dataset<L,F> data,
L positiveClass) |
PrecisionRecallStats(int tp,
int fp,
int fn)
Constructs a new PrecisionRecallStats with the given initial counts.
|
Modifier and Type | Method and Description |
---|---|
void |
addCounts(PrecisionRecallStats prs)
Adds the counts from the given stats to the counts of this stats.
|
void |
addFN(int count)
Adds the given number to the count of false negatives.
|
void |
addFP(int count)
Adds the given number to the count of false positives.
|
void |
addTP(int count)
Adds the given number to the count of true positives.
|
String |
getF1Description(int numDigits)
Returns a String summarizing F1 that will print nicely.
|
double |
getFMeasure()
Returns the current F1 measure (alpha=0.5).
|
double |
getFMeasure(double alpha)
Returns the F-Measure with the given mixing parameter (must be between 0 and 1).
|
int |
getFN()
Returns the current count of false negatives.
|
int |
getFP()
Returns the current count of false positives.
|
double |
getPrecision()
Returns the current precision: tp/(tp+fp).
|
String |
getPrecisionDescription(int numDigits)
Returns a String summarizing precision that will print nicely.
|
double |
getRecall()
Returns the current recall: tp/(tp+fn).
|
String |
getRecallDescription(int numDigits)
Returns a String summarizing recall that will print nicely.
|
int |
getTP()
Returns the current count of true positives.
|
void |
incrementFN()
Adds one to the count of false negatives.
|
void |
incrementFP()
Adds one to the count of false positives.
|
void |
incrementTP()
Adds one to the count of true positives.
|
String |
toString()
Returns a String representation of this PrecisionRecallStats, indicating the number of tp, fp, fn counts.
|
String |
toString(int numDigits) |
protected int tpCount
protected int fpCount
protected int fnCount
public PrecisionRecallStats()
public PrecisionRecallStats(Classifier<L,F> classifier, Dataset<L,F> data, L positiveClass)
public PrecisionRecallStats(int tp, int fp, int fn)
public int getTP()
public int getFP()
public int getFN()
public void addTP(int count)
public void incrementTP()
public void addFP(int count)
public void incrementFP()
public void addFN(int count)
public void incrementFN()
public void addCounts(PrecisionRecallStats prs)
public double getPrecision()
public String getPrecisionDescription(int numDigits)
public double getRecall()
public String getRecallDescription(int numDigits)
public double getFMeasure()
public double getFMeasure(double alpha)
public String getF1Description(int numDigits)
public String toString()
public String toString(int numDigits)