Description Usage Arguments Value See Also Examples
for a set of predictions from different models, evaluate multiple metrics and return the results in a tabular format that makes it easy to compare the predictions.
1 |
.dataset |
data frame with the predictions, it must have at least the column with the observed data and at least one column that refers to the predictions of a model. |
.observed |
string with the name of the column that contains the observed data. |
.predictions |
string or vector of strings the columns where the predictions are stored. |
.metrics |
metric or set of metrics to be evaluated, the metrics refer to those allowed by the package 'yardstick' from 'tidymodels'. |
value_table |
TRUE to display disaggregated metrics. |
data frame with 4 columns: the evaluation metrics, the estimator used, the value of the metric and the name of the model.
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 29 30 31 32 33 34 35 36 | set.seed(123)
library(yardstick) # métricas
predictions <-
data.frame(truth = runif(100),
predict_model_1 = rnorm(100, mean = 1,sd =2),
predict_model_2 = rnorm(100, mean = 0,sd =2),
predict_model_3 = rnorm(100, mean = 0,sd =3))
multieval(.dataset = predictions,
.observed = "truth",
.predictions = c("predict_model_1","predict_model_2","predict_model_3"),
.metrics = list(rmse = rmse, rsq = rsq, mae = mae),
value_table = TRUE)
# Output ----------------------
# A tibble: 9 x 4
# .metric .estimator .estimate model
# <chr> <chr> <dbl> <chr>
# 1 mae standard 1.45 predict_model_1
# 2 mae standard 1.67 predict_model_2
# 3 mae standard 2.43 predict_model_3
# 4 rmse standard 1.78 predict_model_1
# 5 rmse standard 2.11 predict_model_2
# 6 rmse standard 3.01 predict_model_3
# 7 rsq standard 0.00203 predict_model_1
# 8 rsq standard 0.0158 predict_model_2
# 9 rsq standard 0.00254 predict_model_3
#$summary_table
# A tibble: 3 x 4
# model mae rmse rsq
# <chr> <dbl> <dbl> <dbl>
# 1 predict_model_1 1.45 1.78 0.00203
# 2 predict_model_2 1.67 2.11 0.0158
# 3 predict_model_3 2.43 3.01 0.00254
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.