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) }