View source: R/plot_stability.R
| plot_stability | R Documentation |
Creates a visualization showing the variability of model predictions across multiple runs. This helps identify whether instability is uniform across the dataset or concentrated on specific observations.
plot_stability(predictions_matrix, type = c("range", "sd"), ...)
predictions_matrix |
A numeric matrix or data.frame where each row represents an observation and each column represents predictions from a single model run or resample. |
type |
Character string indicating what the error bars represent.
Either |
... |
Additional arguments passed to |
The plot displays the mean prediction for each observation with error bars representing the range (minimum and maximum) or standard deviation of predictions across runs.
No return value, called for side effects (plotting).
# Simulate predictions from 5 model runs
set.seed(42)
base_predictions <- sort(rnorm(50))
predictions <- matrix(
rep(base_predictions, 5) + rnorm(250, sd = 0.2),
ncol = 5
)
plot_stability(predictions, main = "Model Prediction Stability")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.