public class PrecisionRecallCurve extends BaseCurve
Modifier and Type | Class and Description |
---|---|
static class |
PrecisionRecallCurve.Confusion |
static class |
PrecisionRecallCurve.Point |
DEFAULT_FORMAT_PREC
Constructor and Description |
---|
PrecisionRecallCurve(double[] threshold,
double[] precision,
double[] recall,
int[] tpCount,
int[] fpCount,
int[] fnCount,
int totalCount) |
Modifier and Type | Method and Description |
---|---|
double |
calculateAUPRC() |
static PrecisionRecallCurve |
fromJson(String json) |
static PrecisionRecallCurve |
fromYaml(String yaml) |
PrecisionRecallCurve.Confusion |
getConfusionMatrixAtPoint(int point)
Get the binary confusion matrix for the given position.
|
PrecisionRecallCurve.Confusion |
getConfusionMatrixAtThreshold(double threshold)
Get the binary confusion matrix for the given threshold.
|
PrecisionRecallCurve.Point |
getPointAtPrecision(double precision)
Get the point (index, threshold, precision, recall) at the given precision.
|
PrecisionRecallCurve.Point |
getPointAtRecall(double recall)
Get the point (index, threshold, precision, recall) at the given recall.
|
PrecisionRecallCurve.Point |
getPointAtThreshold(double threshold)
Get the point (index, threshold, precision, recall) at the given threshold.
|
double |
getPrecision(int i) |
double |
getRecall(int i) |
double |
getThreshold(int i) |
String |
getTitle() |
double[] |
getX() |
double[] |
getY() |
int |
numPoints() |
calculateArea, calculateArea, format, fromJson, fromYaml, toJson, toYaml
public PrecisionRecallCurve(double[] threshold, double[] precision, double[] recall, int[] tpCount, int[] fpCount, int[] fnCount, int totalCount)
public int numPoints()
public String getTitle()
public double getThreshold(int i)
i
- Point number, 0 to numPoints()-1 inclusivepublic double getPrecision(int i)
i
- Point number, 0 to numPoints()-1 inclusivepublic double getRecall(int i)
i
- Point number, 0 to numPoints()-1 inclusivepublic double calculateAUPRC()
public PrecisionRecallCurve.Point getPointAtThreshold(double threshold)
threshold
- Threshold to get the point forpublic PrecisionRecallCurve.Point getPointAtPrecision(double precision)
precision
- Precision to get the point forpublic PrecisionRecallCurve.Point getPointAtRecall(double recall)
recall
- Recall to get the point forpublic PrecisionRecallCurve.Confusion getConfusionMatrixAtThreshold(double threshold)
getPointAtThreshold(double)
,
if the threshold is not found exactly, the next highest threshold exceeding the requested threshold
is returnedthreshold
- Threshold at which to get the confusion matrixpublic PrecisionRecallCurve.Confusion getConfusionMatrixAtPoint(int point)
getPointAtThreshold(double)
.point
- Position at which to get the binary confusion matrixpublic static PrecisionRecallCurve fromJson(String json)
public static PrecisionRecallCurve fromYaml(String yaml)
Copyright © 2020. All rights reserved.