R/isotone.R
solveIsotone.RdReturn a vector of length y that is a function of x (differs at must where x differs) obeying the either the same order contraints or the opposite order constraints as x. This vector is picked as close to y (by square-distance) as possible.
solveIsotone(varName, x, y, w = NULL)
| varName | character, name of variable |
|---|---|
| x | numeric, factor, or character input (not empty, no NAs). |
| y | numeric (same length as x no NAs), output to match |
| w | numeric positive, same length as x (weights, can be NULL) |
isotonicly adjusted y (non-decreasing)
Please see https://github.com/WinVector/vtreat/blob/main/extras/MonotoneCoder.md.
#> [1] 1.0 1.5 1.5