이론

데이터 가공 및 탐색적 분석

train.isnull().sum()     # 데이터 가공 == 결측치 확인

image.png

Feature Enginnering

예시

인코딩 변환

# Sex 컬럼을 one-hot encoding, pandas method 존재
sex_encoded = pd.get_dummies(train['Sex'], prefix = 'Sex')  # 범주형 데이터에서 더미형태의 데이터로 변환
train = pd.concat([train, sex_encoded], axis = 1)           # 데이터셋 합치기
train.head(1)

image.png


train = train.drop('Sex', axis = 1)
train.head(1)