Skip to contents

A single model prints its describe() output, unless verbosity = 0, and returns its default plot() view: true/predicted values for regression, confusion matrices for classification, and stored metric distributions for resampled models. plot_roc() draws ROC curves for classification models with predicted probabilities.

Usage

present(x, ...)

Arguments

x

rtemis model or List: Fitted ordinary/resampled models.

...

Arguments for the selected presentation: what, verbosity, and drawing arguments. Resampled models accept metric. Lists accept metric, model_names, what, ylim, boxpoints, quartiles, whisker, palette, theme, width, height, and filename. Single models forward drawing arguments to their plot() method. Comparison lists use training/test samples; individual ordinary models also support validation. Explicit ylim is a finite increasing pair for comparisons.

Value

htmlwidget: One chart or one complete rtemis.draw::draw_panels() figure.

Details

A nonempty homogeneous list compares models of the same task and sampling kind. Ordinary models use grouped metric bars. Resampled models use one boxplot panel per sample with common value limits and aligned model labels. Fold counts may differ; fold scores are neither paired nor pooled across models. Missing scores stay missing. Wholly unavailable samples are omitted under what = "all"; explicit unavailable samples are errors.

Comparison labels use model_names, complete list names, or algorithm names, made unique in that order. The existing rtemis data-fingerprint mismatch notice is retained, including when descriptions are disabled.

Default plots

plot() on a fitted model draws the view present() returns, without the description:

  • Regression: plot_true_pred() for all available samples.

  • Classification: confusion matrices for all available samples, as drawn by plot_true_pred().

  • RegressionRes and ClassificationRes: plot_metric() for all available samples.

Arguments after x are passed to the corresponding plot_*() method, for example plot(model, what = "test") or plot(model, metric = "rmse").

Model plots color each data split the same way: training teal, validation purple, test magenta. A supplied palette replaces these colors. Confusion matrices shade correct predictions blue and incorrect predictions orange.

Examples

if (FALSE) { # interactive()
model <- train(mtcars[, c("wt", "mpg")],
  hyperparameters = setup_GLM(), verbosity = 0L)
present(model, verbosity = 0L)
plot(model)
}