Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save halflearned/1ed2180ce790d2bb63040b38a31f5369 to your computer and use it in GitHub Desktop.
Save halflearned/1ed2180ce790d2bb63040b38a31f5369 to your computer and use it in GitHub Desktop.
DiceKriging-related bugs in grf
library(grf)
n <- 100
k <- 3
X <- matrix(rnorm(n*k), n, k)
# Outcome is constant!
Y_constant <- matrix(rep(0, n))
# Outcome is almost constant!
Y_almostconstant <- matrix(rep(0, n))
Y_almostconstant[1] <- 1
# This part happens inside
cat("I'm about to say something about the learning minor or order 1\n")
tryCatch(
grf::regression_forest(X=X, Y=Y_constant, tune.parameters = TRUE),
ecrror=function(e) print(e)
)
cat("I'm about to say something about an argument not being a matrix\n")
tryCatch(
grf::regression_forest(X=X, Y=Y_almostconstant, tune.parameters = TRUE),
error=function(e) print(e)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment