title: sklearn train_test_split - ValueError: Found input variables with inconsistent numbers of samples
body: <p>I have a multi-label classification problem, for which I looked online and saw that for one-hot encoding the labels it is best to use the <code>MultiLabelBinarizer</code>.</p>
  <p>I use this for my labels (which i separate from the dataset itself) as follows:</p>
  <pre><code>ohe = MultiLabelBinarizer()
  labels = ohe.fit_transform(labels)
  train, test, train_labels, test_labels = train_test_split(dataset, labels, test_size=0.2) #80% train split
  </code></pre>
  <p>But it throws me this following error:</p>
  <pre><code>Traceback (most recent call last): 
    File &quot;learn.py&quot;, line 114, in &lt;module&gt; 
      train, test, train_labels, test_labels = train_test_split(dataset, labels, test_size=0.2) #80% train split
    File &quot;C:\Users\xwb18152\AppData\Roaming\Python\Python38\site-packages\sklearn\model_selection\_split.py&quot;, line 2127, 
  in train_test_split
      arrays = indexable(*arrays)
    File &quot;C:\Users\xwb18152\AppData\Roaming\Python\Python38\site-packages\sklearn\utils\validation.py&quot;, line 293, in indexable
      check_consistent_length(*result)
    File &quot;C:\Users\xwb18152\AppData\Roaming\Python\Python38\site-packages\sklearn\utils\validation.py&quot;, line 256, in check_consistent_length
      raise ValueError(&quot;Found input variables with inconsistent numbers of&quot;
  ValueError: Found input variables with inconsistent numbers of samples: [83292, 5]
  </code></pre>
  <p>--</p>
  <p><strong>EDIT:</strong> The labels dataset looks as follows (ignore the <code>Interval</code> column, this shouldnt be there and is not actually counted in the rows -- not sure why?):</p>
  <pre><code>          Movement  Distance  Speed  Delay  Loss 
  Interval
  0                1         1     25      0     0
  2                1         1     25      0     0
  4                1         1     25      0     0
  6                1         1     25      0     0
  8                1         1     25      0     0
  ...            ...       ...    ...    ...   ...
  260              3         5     50      0     0
  262              3         5     50      0     0
  264              3         5     50      0     0
  266              3         5     50      0     0
  268              3         5     50      0     0
  </code></pre>
  <p>From this we can see that it is a multi-label multi-class classification problem. The <code>shape</code> of the <code>dataset</code> and <code>labels</code> before and after the Binarizer are as follows:</p>
  <pre><code>             Before             After
  dataset      (83292, 15)        (83292, 15)
  labels       (83292, 5)         (5, 18)
  </code></pre>