मॉडल को फिट करना और आकलन करना
अब जबकि आपने missing values को हैंडल कर लिया है और dummy variables बना लिए हैं, तो मॉडल के प्रदर्शन का आकलन करने का समय है!
attrition डेटासेट, साथ ही test और train स्प्लिट्स, lr_recipe और आपका घोषित logistic_model() — ये सब आपके लिए लोड कर दिए गए हैं.
यह अभ्यास पाठ्यक्रम का हिस्सा है
R में Feature Engineering
अभ्यास निर्देश
- मॉडल और recipe को एक वर्कफ़्लो में बंडल करें.
- वर्कफ़्लो को train डेटा पर फिट करें.
- प्रदर्शन आकलन के लिए एक augmented data frame जनरेट करें.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Bundle model and recipe in workflow
lr_workflow <- ___() %>%
add_model(lr_model) %>%
add_recipe(lr_recipe)
# Fit workflow to the train data
lr_fit <- ___(lr_workflow, data = train)
# Generate an augmented data frame for performance assessment
lr_aug <- lr_fit %>% ___(test)
lr_aug %>% roc_curve(truth = Attrition, .pred_No) %>% autoplot()
bind_rows(lr_aug %>% roc_auc(truth = Attrition, .pred_No),
lr_aug %>% accuracy(truth = Attrition, .pred_class))