Learn R Programming

rtemis (version 0.79)

massCART: Mass-univariate CART prediction and variable importance

Description

Predict outcome from each predictor separately and rank by percent Variance explained or Classification Accuracy

Usage

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, ...)

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

metric

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.

minsplit

[gS] Integer: Minimum number of cases that must belong in a node before considering a split. Default = 2

minbucket

[gS] Integer: Minimum number of cases allowed in a child node. Default = round(minsplit/3)

cp

[gS] Float: Complexity threshold for allowing a split. Default = .01

maxdepth

[gS] Integer: Maximum depth of tree. Default = 20

ipw

Logical: If TRUE, apply inverse probability weighting (for Classification only). Note: If weights are provided, ipw is not used. Default = TRUE

upsample

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

upsample.seed

Integer: If provided, will be used to set the seed during upsampling. Default = NULL (random seed)

n.cores

Integer: Number of cores to use

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)

verbose

Logical: If TRUE, print summary to screen.

grid.verbose

Logical: Passed to gridSearchLearn

print.plot

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