Description Usage Arguments Value Examples
View source: R/metrics.logloss.solve.R
Reverse engineers the prediction or the positive sample ratio to provide to achieve a known loss.
1 2 | metrics.logloss.solve(to_solve, known_loss = NULL, known_pred = NULL,
known_ratio = NULL)
|
to_solve |
Type: character. What to solve.
|
known_loss |
Type: numeric. The known loss issued from the logartihmic loss. |
known_pred |
Type: numeric. The prediction value which must be fixed. Must be provided when |
known_ratio |
Type: numeric. The positive ratio which must be fixed. Must be provided when |
The solved value.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # Note: this example unexpectedly fails when using pkgdown.
# Example from https://www.kaggle.com/opanichev/mean-baseline-lb-0-30786/code
# WSDM - KKBox's Churn Prediction Challenge (public score: 0.17689)
# Reverse engineeer ratio of positives in Public Leaderboard
print(metrics.logloss.solve(to_solve = "ratio",
known_loss = 0.17695680071494552,
known_pred = 0.08994191315811156), digits = 17)
# Reverse engineer the prediction value used in Public Leaderboard
print(metrics.logloss.solve(to_solve = "pred",
known_loss = 0.17695680071494552,
known_ratio = 29650 / (800000 + 29650)), digits = 17)
# Find better prediction value for the Public Leaderboard
print(metrics.logloss.solve(to_solve = "pred",
known_loss = 0,
known_ratio = 29650 / (800000 + 29650)), digits = 17)
cat("My better logloss: ",
-1 * ((0.03573796) * log(0.03573796) + ((1 - 0.03573796) * log(1 - 0.03573796))),
sep = "")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.