How to solve the problem Error in UseMethod?

171 views Asked by At

I used the code

library(survivalmodels)
library(survival)
library(reticulate)

set.seed(10)
data <- simsurvdata(20)
fit <- deepsurv(data=data[1:10, ])
p <- predict(fit, type="risk", newdata=data[11:20, ])
concordance(risk=p, truth=data[11:20, "time"])

and ran into this error:

Error in UseMethod("concordance") :
  no applicable method for 'concordance' applied to an object of class "c('double', 'numeric')"

How can I solve the problem?

0

There are 0 answers