Skip to content

Commit

Permalink
Update make_basis.R
Browse files Browse the repository at this point in the history
  • Loading branch information
Larsvanderlaan authored Aug 13, 2023
1 parent 8ad9012 commit 6aba854
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/make_basis.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 6aba854

Please sign in to comment.