고민있어요
원핫 인코딩
- 좋아요수
- 0
- 댓글수
- 1
- 조회수
- 346
고민있어요
질문&답변
혹시 for col in cols: le = LabelEncoder() train[col] = le.fit_transform(train[col]) test[col] = le.transform(test[col]) 하게 되면 train으로 학습하고 라벨인코딩 한걸 test에 집어넣으니깐 굳이 concat해서 통합 인코딩 하는 것과 같이 괜찮은거 아닌가해서요..
질문&답변
print(cols)는 class 'list'> Index(['workclass', 'education', 'marital.status', 'occupation', 'relationship', 'race', 'sex', ' native.country '], dtype='object') 이렇게 나왔구요. X_train.head()는 아래와 같습니다..