| plot.coxkl_ridge | R Documentation |
coxkl_ridgePlots model performance across the lambda sequence. Performance is
loss (-2 times partial log-likelihood) or concordance index (C-index).
If no test data are provided, the curve uses the training data stored in x$data.
## S3 method for class 'coxkl_ridge'
plot(
x,
test_z = NULL,
test_time = NULL,
test_delta = NULL,
test_stratum = NULL,
criteria = c("loss", "CIndex"),
...
)
x |
A fitted model object of class |
test_z |
Optional numeric matrix of test covariates. |
test_time |
Optional numeric vector of test survival times. |
test_delta |
Optional numeric vector of test event indicators. |
test_stratum |
Optional vector of test stratum membership. |
criteria |
Character string: |
... |
Additional arguments (ignored). |
When criteria = "loss" and no test data are supplied, the plotted values are
-2 * x$likelihood (no normalization). When test data are provided,
performance is computed via test_eval(..., criteria). The x-axis is shown
in decreasing lambda with a reversed log10 scale.
A ggplot object showing the performance curve.
data(ExampleData_highdim)
train_dat_highdim <- ExampleData_highdim$train
test_dat_highdim <- ExampleData_highdim$test
beta_external_highdim <- ExampleData_highdim$beta_external
model_ridge <- coxkl_ridge(z = train_dat_highdim$z,
delta = train_dat_highdim$status,
time = train_dat_highdim$time,
beta = beta_external_highdim,
eta = 1)
plot(
model_ridge,
test_z = test_dat_highdim$z,
test_time = test_dat_highdim$time,
test_delta = test_dat_highdim$status,
test_stratum = test_dat_highdim$stratum,
criteria = "CIndex"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.