베이스라인
attrition_num 데이터셋을 계속 사용해, 추가적인 피처 엔지니어링 단계의 효과를 평가할 수 있도록 기본 레시피만으로 베이스라인을 만들겠습니다. attrition_num 데이터, 로지스틱 회귀 lr_model, 사용자 정의 함수 class-evaluate(), 그리고 train 및 test 분할은 이미 로드되어 있습니다.
이 연습은 강의의 일부입니다
R로 배우는 Feature Engineering
연습 안내
- 모델과 레시피를 워크플로에 묶으세요.
- 평가를 준비할 수 있도록 적합한 워크플로에
augment()를 적용하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
lr_recipe_plain <- recipe(Attrition ~., data = train)
# Bundle the model and recipe
lr_workflow_plain <- workflow() %>%
___(lr_model) %>%
___(lr_recipe_plain)
lr_fit_plain <- lr_workflow_plain %>%
fit(train)
# Augment the fit workflow
lr_aug_plain <- lr_fit_plain %>%
___(___)
lr_aug_plain %>%
class_evaluate(truth = Attrition,estimate = .pred_class,
.pred_No)