vtreat (version 1.6.4)

square_windowc: Build a square windows variable, categorical target.

Description

Build a square moving average window (KNN in 1d). This is a high-frequency feature. Approximation of the change in log odds.

Usage

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

Value

segmented y prediction

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) IGNORED

Examples

Run this code

d <- data.frame(x = c(NA, 1:6), y = c(0, 0, 0, 1, 1, 0, 0))
square_window("v", d$x, d$y)


Run the code above in your browser using DataCamp Workspace