Skip to content
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

Common error accumulation #40

Open
nt-williams opened this issue May 12, 2020 · 2 comments
Open

Common error accumulation #40

nt-williams opened this issue May 12, 2020 · 2 comments

Comments

@nt-williams
Copy link
Owner

nt-williams commented May 12, 2020

Common errors/issues that aren't explicitly checked for should now be listed here:

  • user calls make_learner() instead of make_learner_stack() with multiple learners.
  • Factor levels in shift function don't respect the levels in the unshifted data resulting in different column names when expanded into dummy codes.
@kathoffman
Copy link
Collaborator

Other potential errors you might want to cover:

Accidentally putting the treatment or outcome in the predictor matrix (lol) could yield an error from lmtp instead of sl3's non-informative one to make it easier for users to figure out what's going on.

library(lmtp)

# Code modified from Example 5.1
a <- "trt"
y <- paste0("Y.", 1:6)
cens <- paste0("C.", 0:5)
baseline <- c("W1", "W2", "trt")

progressr::with_progress({
  psi5.1 <- lmtp_tmle(sim_point_surv_constant, a, y, baseline, cens = cens,
                      shift = static_binary_on, folds = 2,
                      outcome_type = "survival")
})

Error in private$.train(subsetted_task, trained_sublearners) :
All learners in stack have failed
Error in private$.train(subsetted_task, trained_sublearners) :
All learners in stack have failed
Error in self$compute_step() :
Error in private$.train(subsetted_task, trained_sublearners) :
All learners in stack have failed
Failed on Stack
Warning message:
In private$.train(subsetted_task, trained_sublearners) :
Lrnr_glm_TRUE failed with message: Error in data.table::setnames(subset, true_columns, columns): Some duplicates exist in 'old': [trt]
. It will be removed from the stack

@kathoffman
Copy link
Collaborator

You could also add a warning message that the k argument will be ignored for point treatments if users input it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants