View source: R/plot.gg_brier.R
| plot.gg_brier | R Documentation |
gg_brier objectDraws the time-resolved Brier score or the running CRPS from a
gg_brier object. The curve moves across the event-time
grid on the x-axis; lower values mean the forest's predicted survival
probabilities are closer to what actually happened. Think of
0 as "perfect" and roughly 0.25 as "uninformative" – a
forest that predicts 0.5 for every subject regardless of
prognosis would sit near that ceiling.
## S3 method for class 'gg_brier'
plot(x, type = c("brier", "crps"), envelope = FALSE, ...)
x |
A |
type |
Which series to plot: |
envelope |
Logical. When |
... |
Extra arguments forwarded to |
Set envelope = TRUE to add a ribbon around the overall curve
spanning the 15th to 85th percentile of the per-subject Brier
contributions at each time. The ribbon shows how heterogeneous the
scoring is across subjects: a narrow ribbon means most subjects are
predicted equally well (or equally poorly); a wide ribbon means a
minority of subjects are driving the average.
A ggplot object.
gg_brier,
get.brier.survival
library(survival) # Surv() must be on the search path for rfsrc()
data(pbc, package = "randomForestSRC")
rf <- randomForestSRC::rfsrc(Surv(days, status) ~ ., data = pbc,
nsplit = 10)
gg_dta <- gg_brier(rf)
plot(gg_dta)
plot(gg_dta, type = "crps")
plot(gg_dta, envelope = TRUE) # adds 15-85% envelope
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.