Plot True vs. Predicted Values for Supervised objects. For classification, it plots a confusion matrix. For regression, it plots a scatter plot of true vs. predicted values.
Examples
x <- set_outcome(iris, "Sepal.Length")
sepallength_glm <- train(x, algorithm = "GLM")
#> 2026-02-22 18:59:31
#> ▶
#> [train]
#> 2026-02-22 18:59:31
#> Training set: 150 cases x 4 features.
#> [summarize_supervised]
#> 2026-02-22 18:59:31
#> // Max workers: 7 => Algorithm: 1; Tuning: 1; Outer Resampling: 1
#> [get_n_workers]
#> 2026-02-22 18:59:31
#> Training GLM Regression...
#> [train]
#> 2026-02-22 18:59:31
#> Checking data is ready for training...
#>
#> ✓
#> [check_supervised]
#>
#>
#> <Regression>
#> GLM (Generalized Linear Model)
#>
#> <Training Regression Metrics>
#> MAE: 0.24
#> MSE: 0.09
#> RMSE: 0.30
#> Rsq: 0.87
#>
#> 2026-02-22 18:59:31
#> ✓ Done in 0.02 seconds.
#> [train]
plot_true_pred(sepallength_glm)