What does someone mean when they say they re-applied SMOTE multiple times and it significantly increased accuracy. For example, without SMOTE the accuracy was 25% and after re-applying SMOTE 8 times the accuracy went to 89%. The article I was reading compared accuracy when SMOTE was re-applied at different times. Also, how can it be implemented on Python.
I tried this code:
Initialize SMOTE with desired sampling strategy (e.g., ‘auto’ or a specific ratio)
sm = SMOTE(sampling_strategy=’auto’)
Define the number of repetitions
repetitions = [1, 2, 3, 4, 5, 7, 10]
for rep in repetitions:
# Apply SMOTE ‘rep’ times
for _ in range(rep):
X_train, y_train = sm.fit_resample(X_train, y_train)
# Print the number of samples after SMOTE
print(f"SMOTE {rep} times:")
unique, counts = np.unique(y_train, return_counts=True)
print(dict(zip(unique, counts)))
And I kept getting the same number of samples in the classes and the accuracy didn’t change, it still remained low. I wanted to re-apply SMOTE 1, 2, 3, 4, 5,7 and 10 times then check accuracy after each application
Tiphelele Nxumalo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.