plot_true_pred: Plot a Model's True Versus Predicted Values

plot_true_predR Documentation

Plot a Model's True Versus Predicted Values

Description

S7 generic for ECharts plots of rtemis regression and classification results.

Usage

plot_true_pred(x, ...)

Arguments

x

rtemis regression or classification object: Ordinary or resampled result.

...

Method arguments, including what (Optional Character: "all" or a vector of "training", "validation", "test" sample names) and labelify (Logical: capitalize sample names in the legend or panel titles), followed by additional arguments to rtemis.draw::draw_fit() or rtemis.draw::draw_confusion(). Resampled results do not have validation pairs.

Details

what = "all" selects available training, validation, and test pairs for a regression model, or training and test pairs for a resampled model. An explicitly requested missing sample is an error. Resampled observations are pooled in fold order, keeping repeated observations. Pair lengths and names are checked within each fold before pooling.

Rendering is provided by rtemis.draw::draw_fit(). The API uses draw argument names, including se, square, equal_axes, and title, and a draw rtemis.draw::Theme. Supported fits are "glm", "gam", or NULL.

Classification uses rtemis.draw::draw_confusion() with stored confusion frequencies when available, preserving the producer's class order. Otherwise it counts aligned reference/predicted pairs. An omitted what selects test, validation, then training for an ordinary classifier, or all available samples for a resampled classifier. Multiple samples share one widget and one export. Balanced accuracy in this view is macro recall; it is not the legacy multiclass average of one-versus-rest balanced accuracies. See rtemis.draw::ConfusionConfig for zero-denominator and pooled-count semantics.

Value

htmlwidget: ECharts drawing.

Examples


model <- train(
  mtcars[, c("wt", "hp", "mpg")],
  hyperparameters = setup_GLM(), verbosity = 0L
)
plot_true_pred(model)


rtemis documentation built on Oct. 20, 2026, 1:06 a.m.