-
Machine Learning 실습 (12)Machine Learning 2022. 7. 14. 17:50
for cat_name in cat_feature : dummy = pd.get_dummies(test[cat_name], prefix = cat_name) # 기존 X_train에 병합 X_test = pd.concat([X_test,dummy], axis = 1) # 기존의 컬럼은 삭제 X_test.drop(cat_name, axis = 1, inplace = True)
X_test.info()
# set 집합 set(X_train.columns) - set(X_test.columns)
X_test['Cabin_T'] = 0
X_test.info() X_train.info()
# X_test 순서 정렬 X_test = X_test[X_train.columns]
'Machine Learning' 카테고리의 다른 글
Machine Learning 실습 (14) (0) 2022.07.18 Machine Learning 실습 (13) (0) 2022.07.15 Machine Learning 실습 (11) (0) 2022.07.14 Machine Learning 실습 (10) (0) 2022.07.14 Machine Learning 실습 (9) (0) 2022.07.14