Skip to content

Instantly share code, notes, and snippets.

@kkoehncke kkoehncke/block1.py Secret
Last active Aug 12, 2018

Embed
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',
np.unique(y_train),
y_ints)
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.