classification - R package "tree": how to control the maximum tree depth? -


the r package "tree" restricts maximum tree depth 31. if function tree applied large dataset, limit reached:

> library("tree") > library("elemstatlearn") > data <- list(image=as.matrix(zip.train[,-1]), digit=as.factor(zip.train[,1])) > t <- tree(digit~image, data, split="gini") error in tree(digit ~ image, data, split = "gini") :    maximum depth reached calls: source -> withvisible -> eval -> eval -> tree -> .c 

is there way tell tree stop growing tree when maximum tree depth reached, rather aborting error? (in other words: there equivalent maxdepth parameter of rpart.control?)


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -