public class EvaluationCalibration extends BaseEvaluation<EvaluationCalibration>
Modifier and Type | Field and Description |
---|---|
protected int |
axis |
static int |
DEFAULT_HISTOGRAM_NUM_BINS |
static int |
DEFAULT_RELIABILITY_DIAG_NUM_BINS |
Modifier | Constructor and Description |
---|---|
|
EvaluationCalibration()
Create an EvaluationCalibration instance with the default number of bins
|
|
EvaluationCalibration(int reliabilityDiagNumBins,
int histogramNumBins)
Create an EvaluationCalibration instance with the specified number of bins
|
|
EvaluationCalibration(int reliabilityDiagNumBins,
int histogramNumBins,
boolean excludeEmptyBins)
Create an EvaluationCalibration instance with the specified number of bins
|
protected |
EvaluationCalibration(int axis,
int reliabilityDiagNumBins,
int histogramNumBins,
boolean excludeEmptyBins) |
Modifier and Type | Method and Description |
---|---|
void |
eval(INDArray labels,
INDArray networkPredictions) |
void |
eval(INDArray labels,
INDArray predictions,
INDArray mask) |
void |
eval(INDArray labels,
INDArray networkPredictions,
INDArray maskArray,
List<? extends Serializable> recordMetaData) |
static EvaluationCalibration |
fromJson(String json) |
int |
getAxis()
Get the axis - see
setAxis(int) for details |
int[] |
getLabelCountsEachClass() |
int[] |
getPredictionCountsEachClass() |
Histogram |
getProbabilityHistogram(int labelClassIdx)
Return a probability histogram of the specified label class index.
|
Histogram |
getProbabilityHistogramAllClasses()
Return a probability histogram for all predictions/classes.
|
ReliabilityDiagram |
getReliabilityDiagram(int classIdx)
Get the reliability diagram for the specified class
|
Histogram |
getResidualPlot(int labelClassIdx)
Get the residual plot, only for examples of the specified class..
|
Histogram |
getResidualPlotAllClasses()
Get the residual plot for all classes combined.
|
double |
getValue(IMetric metric)
Get the value of a given metric for this evaluation.
|
void |
merge(EvaluationCalibration other) |
EvaluationCalibration |
newInstance()
Get a new instance of this evaluation, with the same configuration but no data.
|
int |
numClasses() |
void |
reset() |
void |
setAxis(int axis)
Set the axis for evaluation - this is the dimension along which the probability (and label classes) are present.
For DL4J, this can be left as the default setting (axis = 1). Axis should be set as follows: For 2D (OutputLayer), shape [minibatch, numClasses] - axis = 1 For 3D, RNNs/CNN1D (DL4J RnnOutputLayer), NCW format, shape [minibatch, numClasses, sequenceLength] - axis = 1 For 3D, RNNs/CNN1D (DL4J RnnOutputLayer), NWC format, shape [minibatch, sequenceLength, numClasses] - axis = 2 For 4D, CNN2D (DL4J CnnLossLayer), NCHW format, shape [minibatch, channels, height, width] - axis = 1 For 4D, CNN2D, NHWC format, shape [minibatch, height, width, channels] - axis = 3 |
String |
stats() |
attempFromLegacyFromJson, eval, evalTimeSeries, evalTimeSeries, fromJson, fromYaml, reshapeAndExtractNotMasked, toJson, toString, toYaml
public static final int DEFAULT_RELIABILITY_DIAG_NUM_BINS
public static final int DEFAULT_HISTOGRAM_NUM_BINS
protected int axis
protected EvaluationCalibration(int axis, int reliabilityDiagNumBins, int histogramNumBins, boolean excludeEmptyBins)
public EvaluationCalibration()
public EvaluationCalibration(int reliabilityDiagNumBins, int histogramNumBins)
reliabilityDiagNumBins
- Number of bins for the reliability diagram (usually 10)histogramNumBins
- Number of bins for the histogramspublic EvaluationCalibration(int reliabilityDiagNumBins, int histogramNumBins, boolean excludeEmptyBins)
reliabilityDiagNumBins
- Number of bins for the reliability diagram (usually 10)histogramNumBins
- Number of bins for the histogramsexcludeEmptyBins
- For the reliability diagram, whether empty bins should be excludedpublic void setAxis(int axis)
axis
- Axis to use for evaluationpublic int getAxis()
setAxis(int)
for detailspublic void eval(INDArray labels, INDArray predictions, INDArray mask)
eval
in interface IEvaluation<EvaluationCalibration>
eval
in class BaseEvaluation<EvaluationCalibration>
public void eval(INDArray labels, INDArray networkPredictions)
eval
in interface IEvaluation<EvaluationCalibration>
eval
in class BaseEvaluation<EvaluationCalibration>
public void eval(INDArray labels, INDArray networkPredictions, INDArray maskArray, List<? extends Serializable> recordMetaData)
public void merge(EvaluationCalibration other)
public void reset()
public String stats()
public int numClasses()
public ReliabilityDiagram getReliabilityDiagram(int classIdx)
classIdx
- Index of the class to get the reliability diagram forpublic int[] getLabelCountsEachClass()
public int[] getPredictionCountsEachClass()
public Histogram getResidualPlotAllClasses()
public Histogram getResidualPlot(int labelClassIdx)
labelClassIdx
- Index of the class to get the residual plot forpublic Histogram getProbabilityHistogramAllClasses()
public Histogram getProbabilityHistogram(int labelClassIdx)
labelClassIdx
- Index of the label class to get the histogram forpublic static EvaluationCalibration fromJson(String json)
public double getValue(IMetric metric)
IEvaluation
public EvaluationCalibration newInstance()
IEvaluation
Copyright © 2020. All rights reserved.