Class Accuracy

    • Constructor Detail

      • Accuracy

        public Accuracy()
        Creates a multiclass accuracy evaluator that computes accuracy across axis 1 along the 0th index.
      • Accuracy

        public Accuracy​(java.lang.String name)
        Creates a multiclass accuracy evaluator that computes accuracy across axis 1 along the 0th index.
        Parameters:
        name - the name of the evaluator, default is "Accuracy"
      • Accuracy

        public Accuracy​(java.lang.String name,
                        int axis)
        Creates a multiclass accuracy evaluator.
        Parameters:
        name - the name of the evaluator, default is "Accuracy"
        axis - the axis that represent classes in prediction, default 1
    • Method Detail

      • accuracyHelper

        protected ai.djl.util.Pair<java.lang.Long,​NDArray> accuracyHelper​(NDList labels,
                                                                                NDList predictions)
        A helper for classes extending AbstractAccuracy.
        Specified by:
        accuracyHelper in class AbstractAccuracy
        Parameters:
        labels - the labels to get accuracy for
        predictions - the predictions to get accuracy for
        Returns:
        a pair(number of total values, ndarray int of correct values)