การดูแลต้นไม้การจำแนกประเภท

Supervised Learning in R: Classification

Brett Lantz

Instructor

การตัดแต่งก่อน (Pre-pruning)

Early Stopping ด้วย MaxDepth

Early Stopping ด้วย MinSplit

Supervised Learning in R: Classification

การตัดแต่งหลัง (Post-pruning)

การตัดแต่งกิ่งที่ซับซ้อน

กราฟ Error เทียบกับ Complexity

Supervised Learning in R: Classification

Pre- และ Post-pruning ด้วย R

# pre-pruning with rpart
library(rpart)
prune_control <- rpart.control(maxdepth = 30, minsplit = 20)

m <- rpart(repaid ~ credit_score + request_amt,
           data = loans,
           method = "class",
           control = prune_control)
# post-pruning with rpart
m <- rpart(repaid ~ credit_score + request_amt,
           data = loans,
           method = "class")

plotcp(m)

m_pruned <- prune(m, cp = 0.20)
Supervised Learning in R: Classification

มาฝึกกันเถอะ!

Supervised Learning in R: Classification

Preparing Video For Download...