Skip to contents

Evaluates multiple tidylearn models and presents the results side-by-side in a styled gt table.

Usage

tl_table_comparison(..., new_data = NULL, names = NULL, digits = 4)

Arguments

...

tidylearn model objects to compare

new_data

Optional test data for evaluation. If NULL, the models are scored on their training data, which they must share: models fitted on different data are an error asking for new_data. A model fitted on engineered features, as tl_auto_ml() builds some of its candidates, is scored on the training data of the others.

names

Optional character vector of model names

digits

Number of decimal places (default: 4)

Value

A gt table object. Its source note counts the rows scored, per model when the models scored different rows.

Examples

# \donttest{
m1 <- tl_model(mtcars, mpg ~ ., method = "linear")
m2 <- tl_model(mtcars, mpg ~ ., method = "lasso")
tl_table_comparison(m1, m2, names = c("Linear", "Lasso"))
Model Comparison
2 models compared
Metric Linear Lasso
Rmse 2.1469 2.8933
Mae 1.7227 2.2389
Rsq 0.8690 0.7621
tidylearn | n = 32
# }