Skip to content

Instantly share code, notes, and snippets.

@DanielDaCosta
Created May 6, 2020 02:12
Show Gist options
  • Select an option

  • Save DanielDaCosta/516e3ed94468ec10926a5a6b3c764b00 to your computer and use it in GitHub Desktop.

Select an option

Save DanielDaCosta/516e3ed94468ec10926a5a6b3c764b00 to your computer and use it in GitHub Desktop.
Class Weight Medium
weight_binary = {0: 0.5, 1: 7} #values obtained through calculations
weight_categorical = {0: 1.4, 1: 0.43, 2: 7}
classes_weights = {}
# There are 35 outputs in output_columns_binary, having classes (0 or 1)
for i, dense_layer in enumerate(output_columns_binary):
name = f'binary_output_{i}'
classes_weights[name] = weight_binary
# There is only 1 output in output_columns_categorical, having classes (0, 1 or 2)
for i, dense_layer in enumerate(output_columns_categorical):
name = 'categorical_output'
classes_weights[name] = weight_categorical
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment