title: Multi-label compute class weight - unhashable type
body: <p>Working in a <strong><em>multi-label</em></strong> classification problem with <em>13 possibles outputs</em> in my neural network with Keras, sklearn, etc...</p>
  
  <p>Each output can be an array like [0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1 ,0].</p>
  
  <p>I have an imbalance dataset and i trying to apply <strong>compute_class_weight</strong> method, like:</p>
  
  <pre><code>class_weight = compute_class_weight('balanced', np.unique(Y_train), Y_train)
  </code></pre>
  
  <p>When i try to run my code, i got <strong><em>Unhashable Type: 'numpy.ndarray':</em></strong></p>
  
  <pre><code>Traceback (most recent call last):
    File "main.py", line 115, in &lt;module&gt;
      train(dataset, labels)
    File "main.py", line 66, in train
      class_weight = compute_class_weight('balanced', np.unique(Y_train), Y_train)
    File "/home/python-env/env/lib/python3.6/site-packages/sklearn/utils/class_weight.py", line 41, in compute_class_weight
  if set(y) - set(classes):
    TypeError: unhashable type: 'numpy.ndarray'
  </code></pre>
  
  <p>I know that is because i working with arrays, already tried add some dict,</p>
  
  <p>i.e.:</p>
  
  <pre><code>class_weight_dict = dict(enumerate(np.unique(y_train), class_weight))
  </code></pre>
  
  <p>Well, i don't know what to do, tried others strategies, but no success...
  Any ideas?</p>
  
  <p>Thanks in advance!</p>