Predict outcome from each predictor separately and rank by percent Variance explained or Classification Accuracy
massCART(x, y = NULL, x.test = NULL, y.test = NULL, metric = NULL,
minsplit = 2, minbucket = round(minsplit/3), cp = 0.01,
maxcompete = 0, maxsurrogate = 0, usesurrogate = 2,
surrogatestyle = 0, maxdepth = 22, xval = 0, ipw = FALSE,
upsample = FALSE, upsample.seed = NULL, n.cores = 1,
parallel.type = ifelse(.Platform$OS.type == "unix", "fork", "psock"),
save.mod = FALSE, grid.print.plot = FALSE, verbose = TRUE,
grid.verbose = TRUE, print.plot = 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
String: Metric to minimize, or maximize if maximize = TRUE
during grid search.
Default = NULL, which results in "Balanced Accuracy" for Classification,
"MSE" for Regression, and "Coherence" for Survival Analysis.
[gS] Integer: Minimum number of cases that must belong in a node before considering a split. Default = 2
[gS] Integer: Minimum number of cases allowed in a child node. Default = round(minsplit/3)
[gS] Float: Complexity threshold for allowing a split. Default = .01
[gS] Integer: Maximum depth of tree. Default = 20
Logical: If TRUE, apply inverse probability weighting (for Classification only).
Note: If weights
are provided, ipw
is not used. Default = TRUE
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)
Integer: Number of cores to use
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)
Logical: If TRUE, print summary to screen.
Logical: Passed to gridSearchLearn
Logical: if TRUE, produce plot using mplot3
Takes precedence over plot.fitted
and plot.predicted