Skip to content

Error in [.data.frame(data, , x) : undefined columns selected #98

@pkdism

Description

@pkdism

Hi, I'm trying to run xspline and getting this error on passing a simple ranger model to xspline(). I'm suspecting that the issue might be there with this call (this is the only place where data is subsetted):
classes <- get_predictors_classes(data[, predictors])

Here is a reproducible example:

> temp_data <- data.frame(a = rnorm(n = 1000), b = rnorm(n = 1000), y = sample(x = c(TRUE, FALSE), size = 1000, replace = TRUE))
> model_rf <- ranger::ranger(formula = factor(y) ~ ., data = temp_data, min.node.size = 5, importance = "permutation", probability = TRUE)
> xs <- xspliner::xspline(model_rf, data = temp_data)
Error in `[.data.frame`(data, , x) : undefined columns selected
> explainer_rf <- DALEX::explain(model_rf, y = temp_data$y, data = temp_data)
> xs <- xspliner::xspline(explainer_rf, data = temp_data)
Error in `[.data.frame`(data, , x) : undefined columns selected

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions