public class Accuracy extends AbstractAccuracy
Accuracy
is the AbstractAccuracy
with multiple classes.axis, correctInstances, index
totalInstances
Constructor and Description |
---|
Accuracy()
Creates a multiclass accuracy evaluator that computes accuracy across axis 1 along the 0th
index.
|
Accuracy(java.lang.String name,
int index)
Creates a multiclass accuracy evaluator that computes accuracy across axis 1 along given
index.
|
Accuracy(java.lang.String name,
int index,
int axis)
Creates a multiclass accuracy evaluator.
|
Modifier and Type | Method and Description |
---|---|
protected ai.djl.util.Pair<java.lang.Long,NDArray> |
accuracyHelper(NDList labels,
NDList predictions)
A helper for classes extending
AbstractAccuracy . |
addAccumulator, evaluate, getAccumulator, resetAccumulator, updateAccumulator
checkLabelShapes, checkLabelShapes, getName
public Accuracy()
public Accuracy(java.lang.String name, int index)
name
- the name of the evaluator, default is "Accuracy"index
- the index of the NDArray in labels to compute accuracy forpublic Accuracy(java.lang.String name, int index, int axis)
name
- the name of the evaluator, default is "Accuracy"index
- the index of the NDArray in labels to compute accuracy foraxis
- the axis that represent classes in prediction, default 1protected ai.djl.util.Pair<java.lang.Long,NDArray> accuracyHelper(NDList labels, NDList predictions)
AbstractAccuracy
.accuracyHelper
in class AbstractAccuracy
labels
- the labels to get accuracy forpredictions
- the predictions to get accuracy for