-
-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protection stack overflow #103
Comments
This is probably due to the formula interface. Try to use the alternative interface with |
I tried dependent.variable.name="y", it is still not working for me... |
With the same error message? That should only occur with the formula interface. Please give a reproducible example or at least your ranger call and some information to the data. |
I just solved the problem by converting the matrix into sparse matrix. But I also encountered a similar problem when using importance_pvalue(). It only allows data.frame/formula as inputs. Is it possible to make it also compatible with the sparse matrix? The codes I used: |
The In the meantime, the permutation p-values are so simple, you can just do it yourself: library(ranger)
num.permutations <- 100
# Run RF
rf <- ranger(dependent.variable.name = "Species", data = iris, importance = "permutation")
# Permute and compute importance again (be sure to use same parameters as above)
vimp <- replicate(num.permutations, {
dat <- iris
dat[, "Species"] <- dat[sample(nrow(dat)), "Species"]
ranger(dependent.variable.name = "Species", data = dat, importance = "permutation")$variable.importance
})
# Compute p-values
pval <- sapply(1:nrow(vimp), function(i) {
(sum(vimp[i, ] >= rf$variable.importance[i]) + 1)/(ncol(vimp) + 1)
})
res <- cbind(rf$variable.importance, pval)
colnames(res) <- c("importance", "pvalue")
res (this is just copy&paste from the |
Thanks so much! |
ranger (R version) give a Error: protect(): protection stack overflow with a 141*17222 data frame.
I used mtry of 131 and 1000 trees. save.memory = TRUE does not help.
If need it I could provide the data.
The text was updated successfully, but these errors were encountered: