Skip to contents

Echoes the generated SQL verbatim instead of the quoted, escaped form base R would print for a character vector.

Usage

# S3 method for class 'obwoe_sql'
print(x, ...)

Arguments

x

An object of class "obwoe_sql".

...

Additional arguments (currently ignored).

Value

Invisibly returns x.

See also

Examples

# \donttest{
set.seed(1)
df <- data.frame(x = rnorm(500))
df$target <- rbinom(500, 1, plogis(df$x))
print(obwoe_sql(obwoe(df, target = "target"), table = "t"))
#> -- ---------------------------------------------------------------
#> -- Weight of Evidence transformation
#> -- Generated by OptimalBinningWoE 1.13.6
#> -- Algorithm(s): jedi
#> -- Dialect: ansi
#> -- Interval convention: (lower, upper]  -- upper bound inclusive
#> -- Variables: 1
#> --
#> -- Variable                 Type          Bins        IV
#> --   x                      numerical        7   2.80150
#> -- ---------------------------------------------------------------
#> SELECT
#> CASE
#>     WHEN x IS NULL THEN 0
#>     WHEN x <= -1.6372806471047163 THEN -2.4103443042830306
#>     WHEN x > -1.6372806471047163 AND x <= -1.2863005304343256 THEN -1.6262253455173585
#>     WHEN x > -1.2863005304343256 AND x <= -0.7508190011934479 THEN -1.2336636422451022
#>     WHEN x > -0.7508190011934479 AND x <= -0.6212666947968234 THEN -0.9124588777546776
#>     WHEN x > -0.6212666947968234 AND x <= 0.8652230997171378 THEN 0.053821778480813424
#>     WHEN x > 0.8652230997171378 AND x <= 1.6888732862040463 THEN 1.259232397576377
#>     WHEN x > 1.6888732862040463 THEN 20.739395218876293
#>     ELSE 0
#> END AS x_woe
#> FROM t;
# }