calcNCE | R Documentation |
This function computes the normalized cross entropy (NCE) which is given by
\mathrm{NCE} = \frac{\frac{1}{N} ∑_{i=1}^{N} y_i \cdot \log(p_i) + (1-y_i) \cdot \log(1-p_i)}{ p \cdot \log(p) + (1-p) \cdot \log(1-p)}
where (for i \in \lbrace 1,…,N \rbrace) y_i \in \lbrace 0,1 \rbrace are the true classes, p_i are the risk/probability predictions and p = \frac{1}{N} ∑_{i=1}^{N} y_i is total unrestricted empirical risk estimate.
calcNCE(preds, y)
preds |
Numeric vector of risk estimates |
y |
Vector of true binary outcomes |
Smaller values towards zero are generally prefered. A NCE of one or above would indicate that the used model yields comparable or worse predictions than the naive mean model.
The normalized cross entropy
He, X., Pan, J., Jin, O., Xu, T., Liu, B., Xu, T., Shi, Y., Atallah, A., Herbrich, R., Bowers, S., Candela, J. Q. (2014). Practical Lessons from Predicting Clicks on Ads at Facebook. Proceedings of the Eighth International Workshop on Data Mining for Online Advertising 1-9. doi: 10.1145/2648584.2648589
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.