public class AUC2 extends Iced
Modifier and Type | Class and Description |
---|---|
static class |
AUC2.AUCBuilder |
static class |
AUC2.ThresholdCriterion
Criteria for 2-class Confusion Matrices
This is an Enum class, with an exec() function to compute the criteria
from the basic parts, and from an AUC2 at a given threshold index.
|
Modifier and Type | Field and Description |
---|---|
double |
_auc |
double[] |
_fps |
double |
_gini |
int |
_max_idx |
double |
_n |
int |
_nBins |
double |
_p |
double |
_pr_auc |
double[] |
_ths |
double[] |
_tps |
static AUC2.ThresholdCriterion |
DEFAULT_CM |
static int |
NBINS |
Constructor and Description |
---|
AUC2(AUC2.AUCBuilder bldr) |
AUC2(Vec probs,
Vec actls)
Default bins, good answers on a highly unbalanced sorted (and reverse
sorted) datasets
|
Modifier and Type | Method and Description |
---|---|
double[][] |
buildCM(int idx) |
double[][] |
cmByCriterion(AUC2.ThresholdCriterion criterion) |
double[][] |
defaultCM() |
double |
defaultErr() |
double |
defaultThreshold() |
static AUC2 |
emptyAUC()
Creates a dummy AUC2 instance with no metrics, meant to prevent possible NPEs
|
double |
fn(int idx) |
Function<java.lang.Integer,java.lang.Double> |
forCriterion(AUC2.ThresholdCriterion tc) |
double |
fp(int idx) |
boolean |
isEmpty() |
static AUC2 |
make01AUC(AUC2.AUCBuilder bldr)
Creates an instance of AUC2 for classifiers that do not return probabilities, only 0-1.
|
double |
maxF1() |
static double |
perfectAUC(Vec vprob,
Vec vacts) |
double |
pr_auc()
Compute the Area under Precision-Recall Curves using TPs and FPs.
|
double |
threshold(int idx) |
double |
tn(int idx) |
double |
tp(int idx) |
asBytes, clone, copyOver, frozenType, read, readExternal, readJSON, reloadFromBytes, toJsonBytes, toJsonString, write, writeExternal, writeJSON
public final int _nBins
public final double[] _ths
public final double[] _tps
public final double[] _fps
public final double _p
public final double _n
public double _auc
public double _gini
public double _pr_auc
public final int _max_idx
public static final AUC2.ThresholdCriterion DEFAULT_CM
public static final int NBINS
public AUC2(Vec probs, Vec actls)
public AUC2(AUC2.AUCBuilder bldr)
public double threshold(int idx)
public double tp(int idx)
public double fp(int idx)
public double tn(int idx)
public double fn(int idx)
public double maxF1()
public Function<java.lang.Integer,java.lang.Double> forCriterion(AUC2.ThresholdCriterion tc)
public static AUC2 make01AUC(AUC2.AUCBuilder bldr)
bldr
- AUCBuilderpublic static AUC2 emptyAUC()
public boolean isEmpty()
public double pr_auc()
public double[][] buildCM(int idx)
public double[][] defaultCM()
public double[][] cmByCriterion(AUC2.ThresholdCriterion criterion)
criterion
public double defaultThreshold()
public double defaultErr()