Train an Additive Tree model
s.ADDTREE(x, y = NULL, x.test = NULL, y.test = NULL, x.name = NULL,
y.name = NULL, weights = NULL, update = c("exponential",
"polynomial"), min.update = ifelse(update == "polynomial", 0.035,
1000), min.hessian = 0.001, min.membership = 1,
steps.past.min.membership = 0, gamma = 0.8, max.depth = 30,
learning.rate = 0.1, ipw = TRUE, ipw.type = 2, upsample = FALSE,
upsample.seed = NULL, imetrics = TRUE,
grid.resample.rtset = rtset.resample("kfold", 5),
metric = "Balanced Accuracy", maximize = TRUE, prune = TRUE,
prune.empty.leaves = TRUE, remove.bad.parents = FALSE,
match.rules = TRUE, print.plot = TRUE, plot.fitted = NULL,
plot.predicted = NULL, plot.theme = getOption("rt.fit.theme",
"lightgrid"), question = NULL, rtclass = NULL, verbose = TRUE,
prune.verbose = FALSE, trace = 1, grid.verbose = TRUE,
diagnostics = FALSE, outdir = NULL, save.rpart = FALSE,
save.mod = ifelse(!is.null(outdir), TRUE, FALSE), n.cores = rtCores,
...)
N x D matrix of N examples with D features
N x 1 vector of labels with values in -1,1
Numeric vector or matrix / data frame of testing set features
Columns must correspond to columns in x
Numeric vector of testing set outcome
Character: Name for feature set
Character: Name for outcome
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
[gS] Minimum second derivative to continue splitting
[gS] acceleration factor = lambda / (1 + lambda) #' @param max.depth [gS] maximum depth of the tree
[gS] learning rate for the Newton Raphson step that updates the function values of the node
Logical: If TRUE, apply inverse probability weighting (for Classification only).
Note: If weights
are provided, ipw
is not used. Default = TRUE
Integer 0, 1, 2 1: class.weights as in 0, divided by max(class.weights) 2: class.weights as in 0, divided by min(class.weights) Default = 2
Logical: If TRUE, upsample cases to balance outcome classes (for Classification only) Caution: upsample will randomly sample with replacement if the length of the majority class is more than double the length of the class you are upsampling, thereby introducing randomness
Integer: If provided, will be used to set the seed during upsampling. Default = NULL (random seed)
Logical: If TRUE, match cases to rules to get statistics per node, i.e. what percent of cases match each rule. If available, these are used by mplot3.addtree when plotting
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"
String: the question you are attempting to answer with this model, in plain language.
String: Class type to use. "S3", "S4", "RC", "R6"
Logical: If TRUE, print summary to screen.
Integer: If higher than 0, will print more information to the console. Default = 0
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, 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)
Additional arguments
Logical vector with the same length as the feature vector, where TRUE means that the corresponding column of x is a categorical variable
Object of class rtMod
For binary classification, outcome must be factor with two levels, the first level is the 'positive' class
Factor levels should not contain the "/" character (it is used to separate conditions in the addtree object)
[gS] Indicates that more than one value can be supplied, which will result in grid search using internal resampling lambda <- gamma/(1 - gamma)
Valdes G, Luna JM, Eaton E, Simone CB, Ungar LH, Solberg TD. MediBoost: a Patient Stratification Tool for Interpretable Decision Making in the Era of Precision Medicine. Sci Rep. 2016;6:37854. doi:10.1038/srep37854.
Other Supervised Learning: s.ADABOOST
,
s.BART
, s.BAYESGLM
,
s.BRUTO
, s.C50
,
s.CART
, s.CTREE
,
s.DA
, s.ET
,
s.EVTREE
, s.GAM.default
,
s.GAM.formula
, s.GAMSEL
,
s.GAM
, s.GBM3
,
s.GBM
, s.GLMNET
,
s.GLM
, s.GLS
,
s.H2ODL
, s.H2OGBM
,
s.H2ORF
, s.IRF
,
s.KNN
, s.LDA
,
s.LM
, s.MARS
,
s.MLRF
, s.MXN
,
s.NBAYES
, s.NLA
,
s.NLS
, s.NW
,
s.POLYMARS
, s.PPR
,
s.PPTREE
, s.QDA
,
s.QRNN
, s.RANGER
,
s.RFSRC
, s.RF
,
s.SGD
, s.SPLS
,
s.SVM
, s.TFN
,
s.XGBLIN
, s.XGB
Other Tree-based methods: s.ADABOOST
,
s.BART
, s.C50
,
s.CART
, s.CTREE
,
s.ET
, s.EVTREE
,
s.GBM3
, s.GBM
,
s.H2OGBM
, s.H2ORF
,
s.IRF
, s.MLRF
,
s.PPTREE
, s.RANGER
,
s.RFSRC
, s.RF
,
s.XGB