Desicion Tree(CART): Single CART tree with pruning by 10-fold CV

This part is accomplished using tree package in R as used in the paper. Since not much is mentioned in the paper about the set up of the decision tree, the default depth in tree are used. Also 10 fold cross-validation and prune.tree are used as specified in the paper.


In [1]:
suppressMessages(library(tree))
load("../transformed data/golub3571.rda")
load("../transformed data/paper9.rda")
# Settings as specified in the paper
p = 40 # number of genes for FLDA
B = 50 # Aggregation predictors
N = 200 # repeat classification N times
d = c(0.05, 0.1,0.25, 0.5, 0.75, 1) # CPD parameter
set.seed(2017)

In [2]:
cbine_data = data.frame(response = factor(total3571_response), scale_golub_merge)
tree_mdl = tree(response~.,data = cbine_data)
cv_error = replicate(N, ceiling(cv.tree(tree_mdl, , prune.tree, K = 10, method = "misclass")$dev[1]/10))
resultDT = c(Median = median(cv_error), Upper_quartile = quantile(cv_error, 0.75))

In [3]:
resultDT


Median
2
Upper_quartile.75%
2