Which is the main predictor?
You've got a remarkable prediction, but what were the main predictors? How can you make sense of the model so that you can go beyond the raw results? Machine learning models are often criticized for their lack of interpretability. However, variable importance rankings shed some light on the relevance of your chosen features with the outcome. So let's investigate variable importance and go from there.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Feature Engineering in R
คำแนะนำการฝึกหัด
- Create a variable importance chart.
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
lr_fit <- lr_workflow %>%
fit(test)
lr_aug <- lr_fit %>%
augment(test)
lr_aug %>% class_evaluate(truth = Attrition,
estimate = .pred_class,
.pred_No)
# Create a variable importance chart
lr_fit %>%
extract_fit_parsnip() %>%
___(aesthetics = list(fill = "steelblue"), num_features = 5)