1. 학습
  2. /
  3. 강의
  4. /
  5. XGBoost로 익히는 Extreme Gradient Boosting

Connected

연습 문제

신장 질환 케이스 스터디 II: Feature Union

수치형과 범주형 열을 각각 별도로 대치(impute)했으므로, 이제 scikit-learn의 FeatureUnion을 사용해 그 결과를 이어 붙이세요. 각 결과는 두 개의 개별 변환기 객체인 numeric_imputation_mapper와 categorical_imputation_mapper에 담겨 있습니다.

이미 Machine Learning with the Experts: School Budgets에서 FeatureUnion을 보셨을 수도 있어요. 파이프라인과 마찬가지로 (string, transformer) 형태의 튜플 리스트를 전달해야 하며, 각 튜플의 앞부분은 변환기의 이름입니다.

지침

100 XP
  • sklearn.pipeline에서 FeatureUnion을 가져오세요.
  • FeatureUnion()을 사용해 numeric_imputation_mapper와 categorical_imputation_mapper의 결과를 결합하세요. 각각의 이름은 "num_mapper", "cat_mapper"로 지정합니다.