-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: stack failed when calling Lrnr_condensier
with message: Lrnr_condensier_equal.len_25_TRUE_NA_FALSE_NULL.
#101
Comments
@jeremyrcoyle any idea on this? |
I encountered this problem just yesterday as well and considered opening an issue with the |
@osofr - thanks for offering to look into this when you can. Indeed, I can also confirm that the examples related only to |
It appears that this wasn't even a bug after all. Just incorrect syntax for conditional density bin learners. Note that each learner in the above example is being provided options(sl3.verbose = FALSE)
library("condensier")
library("sl3")
library("simcausal")
D <- DAG.empty()
D <-
D + node("W1", distr = "rbern", prob = 0.5) +
node("W2", distr = "rbern", prob = 0.3) +
node("W3", distr = "rbern", prob = 0.3) +
node("sA.mu", distr = "rconst", const = (0.98 * W1 + 0.58 * W2 + 0.33 * W3)) +
node("sA", distr = "rnorm", mean = sA.mu, sd = 1)
D <- set.DAG(D, n.test = 10)
datO <- sim(D, n = 10000, rndseed = 12345)
# ================================================================================
task <- sl3_Task$new(datO, covariates=c("W1", "W2", "W3"),outcome="sA")
lrn1 <- Lrnr_condensier$new(nbins = 35, bin_method = "equal.len", pool = TRUE, bin_estimator =
Lrnr_xgboost$new(nrounds = 50, objective = "reg:logistic"))
lrn2 <- Lrnr_condensier$new(nbins = 25, bin_method = "equal.len", pool = TRUE,
bin_estimator = Lrnr_glm_fast$new(family = binomial()))
lrn3 <- Lrnr_condensier$new(nbins = 20, bin_method = "equal.mass", pool = TRUE,
bin_estimator = Lrnr_xgboost$new(nrounds = 50, objective = "reg:logistic"))
lrn4 <- Lrnr_condensier$new(nbins = 35, bin_method = "equal.len", pool = TRUE,
bin_estimator = Lrnr_xgboost$new(nrounds = 50, objective = "reg:logistic"))
sl <- Lrnr_sl$new(learners = list(lrn1, lrn2, lrn3, lrn4), metalearner = Lrnr_solnp_density$new())
sl_fit <- sl$train(task) |
@wilsoncai1992, please see the updated examples (along with proper Rmd file containing the examples) in osofr/condensier#13 |
Thank you @osofr for looking into this! I can confirm that the new code will work. |
When I try to call
Lrnr_condensier
andtrain
function, SL3 gives the following error (reproduced on both mac and linux):You can reproduce the error with the following code:
The text was updated successfully, but these errors were encountered: