Created
October 13, 2021 17:24
-
-
Save liannewriting/09aae60b251b8623e02db6c6e87a7426 to your computer and use it in GitHub Desktop.
python imbalanced data machine learning classification
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.utils import compute_class_weight | |
weights = compute_class_weight('balanced', classes=df_train['Class'].unique(), y=df_train['Class']) | |
weights |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment