Supervised Learning in R Classification
Supervised Learning in R Classification
//2
//4
//1
Computing probabilities
# Compute P(A)
p_A <- nrow(subset(where9am, location == "office")) / nrow(where9am)
# Compute P(B)
p_B <- nrow(subset(where9am, daytype == "weekday")) / nrow(where9am)
//4
//3
//2
//1
//4
//4
//4
//4
# Summarize the RFM model to see how the parameters were coded
summary(rfm_model)
//2
# Build a lending model predicting loan outcome versus loan amount and credit
score
loan_model <- rpart(outcome ~ loan_amount + credit_score, data = loans,
method = "class", control = rpart.control(cp = 0))
//4
//3
//2
//4
//3