Skip to contents

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.

Usage

plot_true_pred(x, ...)

Arguments

x

Supervised or SupervisedRes object.

...

Additional arguments passed to methods.

Value

plotly object.

Author

EDG

Examples

x <- set_outcome(iris, "Sepal.Length")
sepallength_glm <- train(x, hyperparameters = setup_GLM())
#> 2026-08-09 13:22:37 
#> Checking data is ready for training...
#>  
#>
#> [check_supervised]
#> 2026-08-09 13:22:37 
#>
#>  [train]
#> 2026-08-09 13:22:37 
#> Training set: 150 cases x 4 features.
#>  [summarize_supervised]
#> 2026-08-09 13:22:37 
#> // Max workers: c(system = 7) { Algorithm: 1; Tuning: 1; Outer Resampling: 1 }
#>  [get_n_workers]
#> 2026-08-09 13:22:37 
#> Training GLM Regression...
#>  [train]
#> 2026-08-09 13:22:37 
#> 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
#>     R²: 0.87
#> 
#> 2026-08-09 13:22:37 
#> Done in 0.03 seconds.
#>  [train]
plot_true_pred(sepallength_glm)