Description Usage Arguments Examples
Main function for creating different types of decision trees
1 2 3 |
formula |
a formula, with a response to left of ~. |
data |
Data frame to run models on |
methods |
Which tree methods to use. Defaults: lm, rpart, ctree, evtree. Also can use "rf" for random forests (cforest from party). Also a FDR pruning method for ctree termed "ctreePrune". Finally bumping is implemented as methods="bump". |
samp.method |
Sampling method. Refer to caret package trainControl() documentation. Default is repeated cross-validation. Other options include "cv" and "boot". |
tuneLength |
Number of tuning parameters to try. Applies to train(). Can also be specified as a vector, with order corresponding to the order specified in the methods argument. |
bump.rep |
Number of repetitions for bumping |
subset |
Whether to split dataset into training and test sets |
perc.sub |
What fraction of data to put into train dataset. 1-frac.sub is allocated to test dataset. Defaults to 0.75 |
weights |
Optional weights for each case. |
verbose |
Whether to print what method on |
1 2 3 4 5 6 7 8 9 10 11 12 13 | # continuous outcome
#library(MASS) # for boston data
#data(Boston)
#out <- dtree(medv ~., data=Boston,methods=c("lm","rpart","ctree"))
#summary(out)
# plot(out$rpart.out)
# categorical outcome
#library(ISLR)
#data(Default)
#out <- dtree(default ~ ., data=Default,methods=c("lm","rpart"))
#summary(out)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.