I have tried to run fastshap on my dataset with more than 120 features and 490,000 rows. However, it keeps having such error pop up " Error in dimnames(x) <- dn : length of 'dimnames' [2] not equal to array extent"
(rf <- ranger(Y ~ ., data = Z, probability = TRUE, write.forest = TRUE))
pfun <- function(object, newdata) { # prediction wrapper
unname(predict(object, data = newdata, type = "response")$predictions[, 1])
}
Hi @bgreenwell ,
I have tried to run fastshap on my dataset with more than 120 features and 490,000 rows. However, it keeps having such error pop up " Error in dimnames(x) <- dn : length of 'dimnames' [2] not equal to array extent"
(rf <- ranger(Y ~ ., data = Z, probability = TRUE, write.forest = TRUE))
pfun <- function(object, newdata) { # prediction wrapper unname(predict(object, data = newdata, type = "response")$predictions[, 1]) }
install.packages("doParallel") library(doParallel)
registerDoParallel(cores = 20) # use forking with 12 cores
shap <- fastshap::explain(rf, X = X1, pred_wrapper = pfun, newdata = random_row, parallel = TRUE)
Does anyone know how to solve this issue?