Train an Additive Tree for Regression
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)
Numeric vector or matrix / data frame of features i.e. independent variables
Numeric vector of outcome, i.e. dependent variable
Numeric vector or matrix / data frame of testing set features
Columns must correspond to columns in x
Numeric vector of testing set outcome
Integer: Max depth of additive tree
Float: lambda parameter for MASS::lm.ridge
Default = .01
Integer: Minimum N observations needed in node, before considering splitting
Integer: Max depth for each tree model within the additive tree
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
Initial value. Default = mean(y)
Logical: Passed to predict.addTree, if TRUE, returns cases by coefficients matrix. Default = FALSE
Logical: If TRUE, print summary to screen.
Integer: If higher than 0, will print more information to the console. Default = 0
Character: Name for feature set
Character: Name for outcome
String: the question you are attempting to answer with this model, in plain language.
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
Logical: if TRUE, produce plot using mplot3
Takes precedence over plot.fitted
and plot.predicted
Logical: if TRUE, plot True (y) vs Fitted
Logical: if TRUE, plot True (y.test) vs Predicted.
Requires x.test
and y.test
String: "zero", "dark", "box", "darkbox"
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)
The Additive Tree grows a tree using a sequence of regularized linear models and tree stumps