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, ...)

Arguments

object

An object of class "fastsvm".

data

A data.frame in the same format used for fitting the model (must contain object$time_col, object$delta_col and all covariates in object$x_cols).

...

Additional arguments passed to methods.

Value

A single numeric value with the estimated concordance index.

Examples

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