Created
August 3, 2020 20:35
-
-
Save MemphisMeng/9f76d21228a2b997a6c35d175ad2b7b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn import preprocessing | |
from imblearn.over_sampling import RandomOverSampler | |
le = preprocessing.LabelEncoder() | |
fixtures['Score'] = le.fit_transform(fixtures['Score'].astype(str)) | |
ros = RandomOverSampler(random_state=42) | |
fixtures, Score_ = ros.fit_resample(fixtures.drop(columns=['Score']), fixtures['Score']) | |
fixtures['Score'] = le.inverse_transform(Score_) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment