Making decisions with trees

Học có giám sát trong R: Phân loại

Brett Lantz

Instructor

A decision tree model

Example Tree Structure

Học có giám sát trong R: Phân loại

Decision trees for prediction

Lending Club Online Application

Học có giám sát trong R: Phân loại

Divide-and-conquer

Divide and Conquer Example

Học có giám sát trong R: Phân loại

Divide-and-conquer

Divide and Conquer Example

Học có giám sát trong R: Phân loại

Divide-and-conquer

Divide and Conquer Example

Học có giám sát trong R: Phân loại

The resulting tree

Divide and Conquer Example

Divide and Conquer Example

Học có giám sát trong R: Phân loại

Building trees in R

# building a simple rpart classification tree
library(rpart)
m <- rpart(outcome ~ loan_amount + credit_score, data = loans,
             method = "class")
# making predictions from an rpart tree
p <- predict(m, test_data, type = "class")
Học có giám sát trong R: Phân loại

Let's practice!

Học có giám sát trong R: Phân loại

Preparing Video For Download...