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. 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)
|
sh: 1: cannot create /dev/null: Permission denied
Loading required package: rpart
Loading required package: party
Loading required package: grid
Loading required package: mvtnorm
Loading required package: modeltools
Loading required package: stats4
Loading required package: strucchange
Loading required package: zoo
Attaching package: ‘zoo’
The following objects are masked from ‘package:base’:
as.Date, as.Date.numeric
Loading required package: sandwich
Loading required package: evtree
Loading required package: partykit
Loading required package: libcoin
Attaching package: ‘partykit’
The following objects are masked from ‘package:party’:
cforest, ctree, ctree_control, edge_simple, mob, mob_control,
node_barplot, node_bivplot, node_boxplot, node_inner, node_surv,
node_terminal, varimp
Loading required package: caret
Loading required package: lattice
Loading required package: ggplot2
sh: 1: cannot create /dev/null: Permission denied
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.