Skip to content

Instantly share code, notes, and snippets.

@kkoehncke kkoehncke/ Secret
Last active Aug 12, 2018

What would you like to do?
#Calculate class weights so we can account for the class imbalance
from sklearn.utils import class_weight
y_ints = [y.argmax() for y in y_train]
class_weights = class_weight.compute_class_weight('balanced',
feed_class_weights = {0: class_weights[0],
1: class_weights[1]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.