Skip to content

Instantly share code, notes, and snippets.

@DexGroves
Created May 22, 2015 16:17
Show Gist options
  • Save DexGroves/c707129c7a3b63748204 to your computer and use it in GitHub Desktop.
Save DexGroves/c707129c7a3b63748204 to your computer and use it in GitHub Desktop.
attempt_plot_gbm <- function(from_github){
# Try to make a simple partial dependency plot with a toy gbm
if (from_github){
devtools::install_github("gbm-developers/gbm")
}
else{
install.packages("gbm", repos = "http://cran.rstudio.com/")
}
library("gbm")
N <- 1000
g <- gbm(y ~ x,
data = data.frame(y = seq(1, 2, length.out = N),
x = seq(1, 2, length.out = N) + runif(N)))
plot(g, i.var = "x")
}
attempt_plot_gbm(from_github = TRUE)
# Make sure you start a fresh R session
attempt_plot_gbm(from_github = FALSE)
@gregridgeway
Copy link

Working on it. Should have a fix shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment