Skip to content

Instantly share code, notes, and snippets.

@f-rumblefish
Last active April 5, 2020 02:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save f-rumblefish/89f5229f4be05c41e8777c31b65bd0bf to your computer and use it in GitHub Desktop.
Save f-rumblefish/89f5229f4be05c41e8777c31b65bd0bf to your computer and use it in GitHub Desktop.
Audio Balancing
# import library
from imblearn.over_sampling import SMOTE
# define the environment variable
seed = 100
k = 1
# apply SMOTE to create the new dataset
sm = SMOTE(sampling_strategy='auto', k_neighbors=k, random_state=seed)
X_res, y_res = sm.fit_resample(pd_mfcc, pd_label)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment