Computes the concordance index (C-index) for a fitted "fastsvm" model
on a given data set. This is a convenience wrapper around the Python
score() method.
# S3 method for class 'fastsvm'
score(object, data, ...)A single numeric value with the estimated concordance index.
if (reticulate::py_module_available("sksurv")) {
set.seed(123)
n <- 80
df <- data.frame(
time = rexp(n, 0.15),
status = rbinom(n, 1, 0.65),
x1 = rnorm(n),
x2 = rnorm(n)
)
fit <- fastsvm(
data = df,
time_col = "time",
delta_col = "status",
kernel = "rbf"
)
score(fit, df)
}
#> [1] 0.6380952