Last active
March 3, 2018 13:28
-
-
Save conormm/11a3a20605b98ad579b9e20d02419eca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| # create range of probabilities | |
| probs <- seq(0, 1, 0.001) | |
| # apply log loss over full range of propabilites | |
| t1 <- logloss(1, probs) | |
| t0 <- logloss(0, probs) | |
| # tidy the data | |
| df <- data.frame(probs = probs, actual_0 = t0, actual_1 = t1) | |
| df <- df %>% gather(label, logloss, actual_0, actual_1) | |
| df <- df %>% filter(logloss != Inf) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment