R로 배우는 Feature Engineering
Jorge Zazueta
Research Professor. Head of the Modeling Group at the School of Economics, UASLP
더 완전한 모델에는 많은 변수가 포함됩니다.
lr_model <- logistic_reg()
lr_recipe <-
recipe(class~ sponsor_code +
contract_value_band +
category_code,
data = grants_train) %>%
step_lencode_glm(sponsor_code,
contract_value_band,
category_code,
outcome = vars(class))
결과도 더 매력적입니다.
lr_aug %>% class_evaluate(truth = class,
estimate = .pred_class,
.pred_successful)
# A tibble: 2 × 3
.metric .estimator .estimate
<chr> <chr> <dbl>
1 accuracy binary 0.890
2 roc_auc binary 0.951
vip() 패키지를 사용하면 중요도 기준으로 정렬된 특징을 시각화할 수 있습니다.
lr_fit %>%
extract_fit_parsnip() %>%
vip(aesthetics =
list(fill = "steelblue"))
변수 중요도 차트

변수 중요도는 도메인 지식을 바탕으로 특징 공학을 개선하는 강력한 피드백 수단이 될 수 있습니다.

R로 배우는 Feature Engineering