How to Calculate Mean Cross Entropy for Accuracy

1.2k Views Asked by At

I have 2 arrays of size N.

X= array of predicted probabilities

Y= observed probabilities

This can be interpreted as

X[i] = the predicted probability of the event occurring on trial i.Values are floats from 0-1

Y[i] = the observed probability of the event occurring on trial i. Values are floats from 0-1

Im using a machine learning model and run it on all N trials in order to produce X. I would like to measure how accurate the model's prediction (X) was to the observed probability (Y).

Im currently using Mean Squared Error to measure accuracy but I think Mean Cross Entropy is a better metric to use. Im not sure how(or if its possible) to Calculate MXE between X & Y?

1

There are 1 best solutions below

4
On

First, this question would be better suited for "Cross Validated" group - statisticians are there. However, $$ CE(X,Y) = -\frac{\sum_j^M{\sum_i^N{X_i \log{Y_i}}}}{M} $$ Where $X_i$ - expected probabilities of events, $Y_i$ - observed. $N$ - set size, $M$ - batch size, so we averaging over batch.