Created
September 10, 2018 12:27
-
-
Save timcdlucas/eac14f7c44b589cbe5bac059e456116e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imp <- list() | |
for(i in 1:50){ | |
r <- randomForest::randomForest(mpg ~ ., data = mtcars, importance = TRUE) | |
m <- lm(mpg ~ ., data = mtcars) | |
m %>% summary | |
imp[[i]] <- r$importance[,1] | |
} | |
imp.df <- do.call(rbind, imp) %>% data.frame | |
imp.df %>% | |
gather(variable, importance) %>% | |
ggplot(aes(x= variable, y = importance)) + | |
geom_boxplot() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment