vtreat
custom coder based on RcppDynProg::solve_for_partition()
.
piecewise_linear(varName, x, y, w = NULL)
character, name of variable to work on.
numeric, input values.
numeric, values to estimate.
numeric, weights.
piecewise_linear("x", 1:8, c(1, 2, 3, 4, 4, 3, 2, 1))
#> [1] 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5
#> attr(,"approx_table")
#> predXs predYs
#> 1 1 2.5
#> 2 8 2.5
#> attr(,"method")
#> [1] "linear"