From f2ccb6717e36fd35cdb43b841e0d8123e9ac1072 Mon Sep 17 00:00:00 2001 From: Lars van der Laan Date: Fri, 11 Aug 2023 06:46:18 -0700 Subject: [PATCH 1/3] Update make_basis.R --- R/make_basis.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/make_basis.R b/R/make_basis.R index c68f783a..46a7fcd6 100644 --- a/R/make_basis.R +++ b/R/make_basis.R @@ -327,7 +327,7 @@ quantizer <- function(X, bins) { p <- max(1 - (20 / nrow(X)), 0.98) quants <- seq(0, p, length.out = bins) - q <- stats::quantile(x, quants) + q <- unique(stats::quantile(x, quants, type = 1)) nearest <- findInterval(x, q) x <- q[nearest] return(x) From 8ad9012304320cf8d607045099f8e86cb582f827 Mon Sep 17 00:00:00 2001 From: Lars van der Laan Date: Fri, 11 Aug 2023 07:17:10 -0700 Subject: [PATCH 2/3] Update R-CMD-check.yml --- .github/workflows/R-CMD-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yml b/.github/workflows/R-CMD-check.yml index 5f2d726f..1c413f21 100644 --- a/.github/workflows/R-CMD-check.yml +++ b/.github/workflows/R-CMD-check.yml @@ -32,7 +32,7 @@ jobs: uses: actions/checkout@v2 - name: Setup R - uses: r-lib/actions/setup-r@master + uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} From 6aba854387db745b1a2b9dc14dcb5e0401996704 Mon Sep 17 00:00:00 2001 From: Lars van der Laan Date: Sun, 13 Aug 2023 12:55:48 -0700 Subject: [PATCH 3/3] Update make_basis.R --- R/make_basis.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/make_basis.R b/R/make_basis.R index 46a7fcd6..d8cd1de2 100644 --- a/R/make_basis.R +++ b/R/make_basis.R @@ -328,7 +328,8 @@ quantizer <- function(X, bins) { p <- max(1 - (20 / nrow(X)), 0.98) quants <- seq(0, p, length.out = bins) q <- unique(stats::quantile(x, quants, type = 1)) - nearest <- findInterval(x, q) + # NOTE: all.inside must be FALSE or else all binary variables are mapped to zero. + nearest <- findInterval(x, q, all.inside = FALSE) x <- q[nearest] return(x) }