Created
May 19, 2021 08:52
-
-
Save seanbenhur/bd896800776d399a02d973f208aa88a8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 reg_resampler import resampler | |
# Initialize the resampler object | |
rs = resampler() | |
# You might recieve info about class merger for low sample classes | |
# Generate classes | |
Y_classes = rs.fit(train, target=target, bins=num_bins) | |
# Create the actual target variable | |
Y = df_train[target] | |
# Create a smote (over-sampling) object from imblearn | |
smote = SMOTE(random_state=27) | |
# Now resample | |
final_X, final_Y = rs.resample(smote, df_train, Y_classes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment