0

I am using mlr3proba package of R for machine learning survival analysis.
My dataset contains factor, numeric and integer features.
To implement SVM I wrote the code below:

task <- TaskSurv$new(id = "id", backend = dataset, time = time, event = status)

train <- sample(task$nrow, 0.8 * task$nrow)
test <- setdiff(seq_len(task$nrow), train)

resampling <- rsmp("cv", folds = 10)

learner <- lrn("surv.svm", gamma.mu ="0.1")

learner$train(task, row_ids = train)

But when I run the last line of code, It shows the error below:

Error in -ub: invalid argument to unary operator

When I run SVM in main survivalsvm package, it works, but in mlr3proba does not work.

Tuner
  • 56
  • 6
  • 1
    The code you posted doesn't work (I think you mean `TaskSurv$new` instead of `TaskSurv`). Please also post the data. – Lars Kotthoff Apr 26 '21 at 21:08
  • 2
    It was a mistake here, but I have written "TaskSurv$new" in my original code. My problem is last line. – Tuner Apr 27 '21 at 02:59
  • 1
    This still isn't a reprex, can you provide [reproducible code](https://stackoverflow.com/help/minimal-reproducible-example) that includes calls to `library`, the version of the packages you are using and a dataset that we can use, or use one of the ones available in mlr3proba. – RaphaelS Apr 27 '21 at 09:49

0 Answers0