solve_piecewisec: Solve as piecewise logit problem, categorical target.

View source: R/segmented_variable.R

solve_piecewisecR Documentation

Solve as piecewise logit problem, categorical target.

Description

Return a vector of length y that is a piecewise function of x. This vector is picked as close to y (by square-distance) as possible for a set of x-only determined cut-points. Cross-validates for a good number of segments.

Usage

solve_piecewisec(varName, x, y, w = NULL)

Arguments

varName

character, name of variable

x

numeric input (not empty, no NAs).

y

numeric or castable to such (same length as x no NAs), output to match

w

numeric positive, same length as x (weights, can be NULL)

Value

segmented y prediction


vtreat documentation built on Aug. 20, 2023, 1:08 a.m.