R/plot_surv_model_performance_rocs.R
plot.surv_model_performance_rocs.Rd
This function plots objects of class "surv_model_performance_rocs"
- ROC curves for
specific time points for survival models created using the model_performance(..., type="roc")
.
# S3 method for surv_model_performance_rocs
plot(
x,
...,
title = "ROC curves for selected time points",
subtitle = "default",
auc = TRUE,
colors = NULL,
facet_ncol = NULL
)
an object of class "surv_model_performance_rocs"
to be plotted
additional objects of class "surv_model_performance_rocs"
to be plotted together
character, title of the plot
character, subtitle of the plot, 'default'
automatically generates "created for XXX, YYY models", where XXX and YYY are the explainer labels
boolean, whether the AUC values should be plotted
character vector containing the colors to be used for plotting variables (containing either hex codes "#FF69B4", or names "blue")
number of columns for arranging subplots
An object of the class ggplot
.
Other functions for plotting 'model_performance_survival' objects:
plot.model_performance_survival()
,
plot.surv_model_performance()
# \donttest{
library(survival)
library(survex)
model <- randomForestSRC::rfsrc(Surv(time, status) ~ ., data = veteran)
exp <- explain(model)
#> Preparation of a new explainer is initiated
#> -> model label : rfsrc ( default )
#> -> data : 137 rows 6 cols ( extracted from the model )
#> -> target variable : 137 values ( 128 events and 9 censored , censoring rate = 0.066 ) ( extracted from the model )
#> -> times : 50 unique time points , min = 1.5 , median survival time = 80 , max = 999
#> -> times : ( generated from y as uniformly distributed survival quantiles based on Kaplan-Meier estimator )
#> -> predict function : sum over the predict_cumulative_hazard_function will be used ( default )
#> -> predict survival function : stepfun based on predict.rfsrc()$survival will be used ( default )
#> -> predict cumulative hazard function : stepfun based on predict.rfsrc()$chf will be used ( default )
#> -> model_info : package randomForestSRC , ver. 3.2.3 , task survival ( default )
#> A new explainer has been created!
m_perf_roc <- model_performance(exp, type = "roc", times = c(100, 300))
plot(m_perf_roc)
# }