인프런 커뮤니티 질문&답변
작업형2 모의문제2 전처리
해결된 질문
작성
·
181
답변 1
0
퇴근후딴짓
지식공유자
target = train.pop('Outcome')타겟 컬럼은 우선 제외하고 합쳐서 인코딩한 후에 다시 나누면 됩니다.
print(train.shape, test.shape)
data = pd.concat([train, test], axis=0)
data_oh = pd.get_dummies(data)
train_oh = data_oh.iloc[:len(train)].copy()
test_oh = data_oh.iloc[len(train):].copy()
print(train_oh.shape, test_oh.shape)






