Skip to content

Instantly share code, notes, and snippets.

@tkazusa
Created December 2, 2018 13:53
Show Gist options
  • Save tkazusa/33f3e08de90fd369038bfaa5c59b18fd to your computer and use it in GitHub Desktop.
Save tkazusa/33f3e08de90fd369038bfaa5c59b18fd to your computer and use it in GitHub Desktop.
# set class weights
classdist = pd.value_counts(val['target'])
weights = {i: round(np.sum(classdist) / classdist[i]) for i in classdist.index}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment