calculate_residual_classification_trajectory: Build residual classification trajectory.

Description Usage Arguments Value Examples

Description

Build a cross-validated residual trajectory for a model. The core idea is: other models factor the quantity to be explained into an explainable versus residual portion (with respect to the given model). Each of these components are possibly useful for modeling.

Usage

1
2
3
4
5
calculate_residual_classification_trajectory(data, vars, ..., dep_var,
  dep_target = TRUE, cross_plan = vtreat::kWayStratifiedY(nrow(data),
  3, data, data[[dep_var]] == dep_target),
  fitter_c = xgboost_fit_predict_c, fitter_r = xgboost_fit_predict_r,
  cl = NULL)

Arguments

data

The data.frame of data to fit.

vars

character vector, explanatory variable names.

...

not used, force arguments to be bound by name

dep_var

character, the name of dependent variable.

dep_target

scalar, the value considered to be the target category of dep_var.

cross_plan

a vtreat-style cross validation plan for data rows (list of disjoint tran/app lists where app partitions the data rows).

fitter_c

fit/predict classification signature function

fitter_r

fit/predict regression signature function

cl

parallel cluster for processing

Value

a matrix with the same number of rows as data representing the cross-validated modeling residual trajectories.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data <- iris
vars <- c("Sepal.Length", "Petal.Length",
          "Sepal.Width", "Petal.Width")
dep_var <- "Species"
dep_target <- "versicolor"
augments <- calculate_residual_classification_trajectory(
  data = data,
  vars = vars,
  dep_var = dep_var,
  dep_target = dep_target
)

WinVector/CVRTSEncoder documentation built on June 7, 2019, 9:53 a.m.