Reputation: 761
How does categorical accuract works? By definition
categorical_accuracy checks to see if the index of the maximal true value is equal to the index of the maximal predicted value.
and
Calculates the mean accuracy rate across all predictions for multiclass classification problems
What does it mean in practice? Lets say i am prediction bounding box of object
it has (xmin,ymin,xmax,ymax) does it check if xmin predicted is equal with xmin real? So if i xmin and xmax where same in prediction and real values, and ymin and ymax were different i would get 50%?
Please help me undestand this concept
Upvotes: 0
Views: 1199
Reputation: 16995
Traditionally for multiclass classification, your labels will have some integer (or equivalently categorical) label; for example:
labels = [0, 1, 2]
The output of a multiclass classification prediction will typically be a probability distribution of confidences; for example:
preds = [0.25, 0.5, 0.25]
Normally the index associated with the most likely event will be the index of the label. In this case, the argmax(preds)
is 1, which maps to label 1
.
You can see the total accuracy of your predictions a la confusion matrices, where one axis is the "true" value, and the other axis is the "predicted" value. The values for each cell are the sums of the values of CM[y_true][y_pred]
. The accuracy will be the sum of main diagonal of the matrix (y_true = y_pred) over the total number of training instances.
Upvotes: 1