Created
February 8, 2020 10:17
-
-
Save szilard/9a7cbaf7e822af7d62c869144ac76622 to your computer and use it in GitHub Desktop.
rpart pruning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(data.table) | |
library(rpart) | |
d_train <- fread("https://s3.amazonaws.com/benchm-ml--main/train-0.1m.csv") | |
md <- rpart(ifelse(dep_delayed_15min=="Y",1,0) ~ ., d_train, | |
control = rpart.control(cp = 0.001)) | |
plotcp(md) | |
printcp(md) | |
md2 <- prune(md, cp=0.004) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment