View source: R/model_metrics.R
| conf_mat | R Documentation |
This function calculates a Confussion Matrix using crosstab for 2 or more categories. You can either set the score and threshold or the labels you wish to cross with.
conf_mat(tag, score, thresh = 0.5, sense = ">=", diagonal = TRUE, plot = FALSE)
tag |
Vector. Real known label |
score |
Vector. Predicted value or model's result |
thresh |
Integer. Threshold for selecting binary or regression
models: this number is the threshold of unique values we should
have in |
sense |
Character. Inequation sense for threshold: <, <=, >=, > |
diagonal |
Boolean. |
plot |
Boolean. Plot result? Uses |
You may use mplot_conf() or set plot=TRUE.
data.frame. Result of counting tag and score's tag
given a threshold, similar to base::table().
Other Machine Learning:
ROC(),
export_results(),
gain_lift(),
h2o_automl(),
h2o_predict_MOJO(),
h2o_selectmodel(),
impute(),
iter_seeds(),
lasso_vars(),
model_metrics(),
model_preprocess(),
msplit()
Other Model metrics:
ROC(),
errors(),
gain_lift(),
loglossBinary(),
model_metrics()
data(dfr) # Results for AutoML Predictions
lapply(dfr[c(1, 2)], head)
# Results for Binomial Model
conf_mat(dfr$class2$tag, dfr$class2$scores)
conf_mat(dfr$class2$tag, dfr$class2$scores, thresh = 0.3)
conf_mat(dfr$class2$tag, dfr$class2$scores, sense = "<=")
# Results for Multi-Categorical Model
conf_mat(dfr$class3$tag, dfr$class3$score)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.