>>> X.shape (392, 8) >>> y.value_counts() # 데이터 불균형 class 0 262 1 130 Name: count, dtype: int64 SMOTE() 사용, up sampling 기법으로 불균형한 데이터의 균형을 맞춰준다. # ! pip install imblearn from imblearn.over_sampling import SMOTE >>> sm = SMOTE(random_state=5) >>> X, y = sm.fit_resample(X, y) >>> X.shape (524, 8) >>> y.shape (524,) >>> y.value_counts() # 데이터 불균형 문제 해결! class 0 262 1 262 Name: count, dtype: int64