CART | R Documentation |
Creates a classification or regression tree.
CART(
formula,
data = NULL,
subset = NULL,
weights = NULL,
output = "Sankey",
missing = "Use partial data",
prune = "None",
early.stopping = TRUE,
auxiliary.data = NULL,
show.labels = FALSE,
predictor.level.treatment = "Abbreviated labels",
outcome.level.treatment = "Full labels",
decimals = NULL,
long.running.calculations = TRUE,
seed = 12321,
...
)
formula |
A formula expression. The left-hand-side (response)
should be either a numerical vector when a regression tree will
be fitted or a factor, when a classification tree is
produced. The right-hand-side should be a series of numeric or
factor variables separated by |
data |
A data frame in which to preferentially interpret formula, weights and subset |
subset |
An optional vector specifying a subset of
observations to be used in the fitting process or the name of a
variable in |
weights |
An optional vector of sampling weights or the name
of a variable in |
output |
How the tree is represented: |
missing |
How missing data is to be treated in the
regression. Options are: |
prune |
How to prune the tree according to the cross-validated
error. Options are: |
early.stopping |
Whether or not to stop building the tree early if splits are not decreasing the lack of fit sufficiently. |
auxiliary.data |
A data frame containing additional variables to be used in imputation. |
show.labels |
Shows the variable labels, as opposed to the names, in the outputs, where a variables label is an attribute (e.g., attr(foo, "label")). |
predictor.level.treatment |
How predictor factor labels are
displayed: |
outcome.level.treatment |
How outcome factor labels are
displayed: |
decimals |
The number of decimal places to show when |
long.running.calculations |
Allow categorical predictors with over 30 levels. |
seed |
The random number seed. |
... |
Other arguments to be supplied to |
Creates an rpart.object
tree and plots it as a
SankeyTree
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.