image_output_1.png
from imblearn.over_sampling import SMOTE

smt = SMOTE(random_state=0)
xtrain_res, ytrain_res = smt.fit_resample(xtrain, ytrain)
print(f'Distribuition BEFORE balancing:\n{ytrain.value_counts()}')
print()
print(f'Distribuition AFTER balancing:\n{ytrain_res.value_counts()}')