Skip to content

Instantly share code, notes, and snippets.

@monogenea
Created October 7, 2019 18:16
Show Gist options
  • Save monogenea/f3c76f1deeff929b41c082c8510dbae6 to your computer and use it in GitHub Desktop.
Save monogenea/f3c76f1deeff929b41c082c8510dbae6 to your computer and use it in GitHub Desktop.
# Validate on test set with ensemble
allPreds <- sapply(modelList, predict, newdata = testSet)
ensemblePred <- rowSums(allPreds) / length(modelList)
# Plot predicted vs. observed; create PNG
plot(ensemblePred, testSet$Y,
xlim = c(0,100), ylim = c(0,100),
xlab = "Predicted", ylab = "Observed",
pch = 16, col = rgb(0, 0, 0, .25))
abline(a=0, b=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment