Created
May 27, 2024 03:32
-
-
Save jgoodie/37848bde13486ed851c5fdcae3139e4d 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
sample_weights = compute_sample_weight(class_weight='balanced',y=df.label) | |
label_weights = { k:v for k, v in sorted(list(zip(df.label, sample_weights)))} | |
label_weights = torch.tensor(list(label_weights.values()), dtype=torch.float32) | |
label_weights |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment