Description Usage Arguments Details Value Examples
View source: R/binary_model_evaluation.R
Accepts a data frame containing the model predictions and actual values. The following classification variables are calculated on the predictions:
1 | binary_model_evaluation(.data, prediction_formula, group_var = NULL)
|
.data |
a data frame |
prediction_formula |
a formula specifiying the dependent binary variable (lhs) and the probability predictions (rhs) |
group_var |
an unquoted variable name to calculate performance measures on each subset of the data - e.g., training/testing splits |
AUC - Area Under the Receiver Operating Curve
KS - Kolmogorov-Smirnov statistic
MSE - Mean Square Error
TPR - True Positive Rate
TNR - True Negative Rate
LSR - Logistic Scoring Rule (Log Loss)
Bias - Direction of Bias
a data frame containing the metrics
1 2 3 4 5 6 7 | iris_ <- iris
iris_$setosa <- ifelse(iris_$Species == "setosa", 1, 0)
iris_$pred <- iris_$Sepal.Length
iris_$pred <- (max(iris_$pred) - iris_$pred) / (max(iris_$pred) - min(iris_$pred) + 1)
iris_$splits <- sample(c("Test", "Train"), size = nrow(iris_), replace = T)
binary_model_evaluation(iris_, setosa ~ pred)
binary_model_evaluation(iris_, setosa ~ pred, group_var = splits)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.