Skip to content

Error in ibrier measure #2789

Closed
Closed
@bommert

Description

@bommert

The code

set.seed(1)
rin = makeResampleInstance(makeResampleDesc("CV", iters = 2), task = wpbc.task)
lrn = makeLearner("surv.coxph", x = TRUE)
resample(lrn, wpbc.task, resampling = rin, measures = list(ibrier))

throws the error:

Error in `[.data.table`(newdata, , tn) : 
  j (the 2nd argument inside [...]) is a single symbol but column name 'tn' is not found. Perhaps you intended DT[, ..tn]. This difference to data.frame is deliberate and explained in FAQ 1.1.

I believe that this error can be fixed by adding with = FALSE in line 1373 in file measures.R such that the new line is

perror = pec(probs, f, data = newdata[, tn, with = FALSE], times = grid, exact = FALSE, exactness = 99L,
      maxtime = max.time, verbose = FALSE, reference = FALSE)

Also, the result of crps(perror, times = max.time) is a crps object that can be coerced to numeric while

crps(perror, times = max.time)[1L, ]

throws the error:

Error in crps(perror, times = max.time)[1L, ] : 
  incorrect number of dimensions

Interestingly, when printing the crps object, then the score is put into a matrix.
Maybe you have a better idea than using as.numeric to access the number stored in the crps object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions