Learn R Programming

rtemis (version 0.79)

s.ADDT: Additive Tree with Linear Nodes [R]

Description

Train an Additive Tree for Regression

Usage

s.ADDT(x, y = NULL, x.test = NULL, y.test = NULL, max.depth = 5,
  lambda = 0.05, minobsinnode = 2, minobsinnode.lin = 10,
  learning.rate = 1, part.minsplit = 2, part.xval = 0,
  part.max.depth = 1, part.cp = 0, weights = NULL, metric = "MSE",
  maximize = FALSE, grid.resample.rtset = rtset.grid.resample(),
  init = NULL, keep.x = FALSE, simplify = TRUE, cxrcoef = FALSE,
  n.cores = rtCores, verbose = TRUE, verbose.predict = FALSE,
  trace = 0, x.name = NULL, y.name = NULL, question = NULL,
  outdir = NULL, print.plot = TRUE, plot.fitted = NULL,
  plot.predicted = NULL, plot.theme = getOption("rt.fit.theme",
  "lightgrid"), save.mod = FALSE)

Arguments

x

Numeric vector or matrix / data frame of features i.e. independent variables

y

Numeric vector of outcome, i.e. dependent variable

x.test

Numeric vector or matrix / data frame of testing set features Columns must correspond to columns in x

y.test

Numeric vector of testing set outcome

max.depth

Integer: Max depth of additive tree

lambda

Float: lambda parameter for MASS::lm.ridge Default = .01

minobsinnode

Integer: Minimum N observations needed in node, before considering splitting

part.max.depth

Integer: Max depth for each tree model within the additive tree

weights

Numeric vector: Weights for cases. For classification, weights takes precedence over ipw, therefore set weights = NULL if using ipw. Note: If weight are provided, ipw is not used. Leave NULL if setting ipw = TRUE. Default = NULL

init

Initial value. Default = mean(y)

cxrcoef

Logical: Passed to predict.addTree, if TRUE, returns cases by coefficients matrix. Default = FALSE

verbose

Logical: If TRUE, print summary to screen.

trace

Integer: If higher than 0, will print more information to the console. Default = 0

x.name

Character: Name for feature set

y.name

Character: Name for outcome

question

String: the question you are attempting to answer with this model, in plain language.

outdir

Path to output directory. If defined, will save Predicted vs. True plot, if available, as well as full model output, if save.mod is TRUE

print.plot

Logical: if TRUE, produce plot using mplot3 Takes precedence over plot.fitted and plot.predicted

plot.fitted

Logical: if TRUE, plot True (y) vs Fitted

plot.predicted

Logical: if TRUE, plot True (y.test) vs Predicted. Requires x.test and y.test

plot.theme

String: "zero", "dark", "box", "darkbox"

save.mod

Logical. If TRUE, save all output as RDS file in outdir save.mod is TRUE by default if an outdir is defined. If set to TRUE, and no outdir is defined, outdir defaults to paste0("./s.", mod.name)

Details

The Additive Tree grows a tree using a sequence of regularized linear models and tree stumps