Description Usage Arguments Details Value Examples
List of prediction functions
1 2 3 4 5 6 7 | get_confusion_matrix(dta, truth, predicted)
get_important_variables(model, plot = FALSE)
plot_distribution(dta, truth = NULL, ...)
get_prediction(dta, model, predicted, score, target_name)
|
dta |
A dataframe that represents model prediction results, score, truth, label to be predicted |
truth |
A column name (in dta) that represents true labels of the predicted target |
predicted |
A column name (in dta) that represents predicted classes |
model |
A ready-built model object |
... |
A list of selected variables |
target_name |
A string that represents label name of the predicted target |
rank_percentile |
A list of percentile to display |
get_prediction
Calculates predicted outcomes and propensity scores from the trained model, and Add the prediction columns to original data frame
plot_distribution
generates plots of distributions with classes
get_confusion_matrix
calculates confusion matrix from prediction results. This confusion matrix contains model accuracy, target coverage, lift up value at each rank percentile
get_important_variables
provides the list of important variables from the ready-built model object
get_confusion_matrix
returns a numeric dataframe of confusion matrix.
get_important_variables
returns a list of important variables
plot_distribution
returns a plot of distributions
get_prediction
returns a dataframe with additional columns: predicted outcomes and propensity score
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | library(tidymodel)
library(dplyr)
# Show data
as_tibble(dta)
get_important_variables(model)
get_confusion_matrix(dta, TARGET1, PREDICTED)
out = plot_distribution(dta,
"TARGET1",
"VAR1",
"VAR2",
"VAR3",
"VAR4")
out = plot_distribution(dta,
NULL,
"VAR1",
"VAR2",
"VAR3",
"VAR4")
# Train data
dta2 = select(dta, TARGET1, VAR1:VAR20)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.