Skip to content

Instantly share code, notes, and snippets.

@bpbond
Last active January 19, 2022 14:44
Show Gist options
  • Save bpbond/8bbb7aa0d0dc845e54b243ae42f1d0f3 to your computer and use it in GitHub Desktop.
Save bpbond/8bbb7aa0d0dc845e54b243ae42f1d0f3 to your computer and use it in GitHub Desktop.
Random Forest on random data
# Makes the inset plot shown in https://twitter.com/BenBondLamberty/status/1483560012844838922?s=20
set.seed(21)
n <- 750
x <- data.frame(x = runif(n))
for(vn in 1:70) {
x[paste0("v", vn)] <- runif(n)
}
library(randomForest)
rfm <- randomForest::randomForest(x ~ ., data = x)
varImpPlot(rfm)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment