<h4 dir="auto">Description</h4>
<p dir="auto"><code class="notranslate">sklearn/utils/multiclass.type_of_target(y)</code> returns different results for practically identical 'y' values when <code class="notranslate">y</code> a <code class="notranslate">list</code> and  when <code class="notranslate">y</code> is an <code class="notranslate">numpy array</code>.</p>
<h4 dir="auto">Steps/Code to Reproduce</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from sklearn.utils import multiclass
import numpy as np
x = [[1, 1], [0, 1]]
y = np.asarray(x)
a = multiclass.type_of_target(x)
b = multiclass.type_of_target(y) 
print(a, b)
assert a == b"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">utils</span> <span class="pl-k">import</span> <span class="pl-s1">multiclass</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-s1">x</span> <span class="pl-c1">=</span> [[<span class="pl-c1">1</span>, <span class="pl-c1">1</span>], [<span class="pl-c1">0</span>, <span class="pl-c1">1</span>]]
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">asarray</span>(<span class="pl-s1">x</span>)
<span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">multiclass</span>.<span class="pl-en">type_of_target</span>(<span class="pl-s1">x</span>)
<span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-s1">multiclass</span>.<span class="pl-en">type_of_target</span>(<span class="pl-s1">y</span>) 
<span class="pl-en">print</span>(<span class="pl-s1">a</span>, <span class="pl-s1">b</span>)
<span class="pl-k">assert</span> <span class="pl-s1">a</span> <span class="pl-c1">==</span> <span class="pl-s1">b</span></pre></div>
<h4 dir="auto">Expected Results</h4>
<p dir="auto">'multilabel-indicator, multilabel-indicator'<br>
No assertion error</p>
<h4 dir="auto">Actual Results</h4>

<p dir="auto">'multiclass-multioutput, multilabel-indicator'<br>
Throws assertion error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="AssertionError"><pre class="notranslate"><code class="notranslate">AssertionError
</code></pre></div>

<h2 dir="auto">System Info</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="System:
    python: 3.6.7rc2 (v3.6.7rc2:4893861ab5, Oct 13 2018, 05:25:29)  [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
executable: /Users/maxwellaladago/Documents/pub/sklearn-dev/venv/bin/python
   machine: Darwin-18.7.0-x86_64-i386-64bit
Python deps:
       pip: 19.2.2
setuptools: 39.1.0
   sklearn: 0.22.dev0
     numpy: 1.17.0
     scipy: 1.3.1
    Cython: 0.29.13
    pandas: None
matplotlib: None
    joblib: 0.13.2"><pre class="notranslate"><code class="notranslate">System:
    python: 3.6.7rc2 (v3.6.7rc2:4893861ab5, Oct 13 2018, 05:25:29)  [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
executable: /Users/maxwellaladago/Documents/pub/sklearn-dev/venv/bin/python
   machine: Darwin-18.7.0-x86_64-i386-64bit
Python deps:
       pip: 19.2.2
setuptools: 39.1.0
   sklearn: 0.22.dev0
     numpy: 1.17.0
     scipy: 1.3.1
    Cython: 0.29.13
    pandas: None
matplotlib: None
    joblib: 0.13.2
</code></pre></div>
<p dir="auto">Will you consider a PR for this? Also, can you clarify what <a href="https://github.com/scikit-learn/scikit-learn/blob/e8f2708e05a9982e86320d994abcbcf02a1536d9/sklearn/utils/multiclass.py#L109"><code class="notranslate">is_multilable's</code></a> behaviour should be? The documentation says it <code class="notranslate">Check if y is in a multilabel format</code> but it seems to be checking whether <code class="notranslate">y</code> is a <code class="notranslate">multi_label_indicator</code> except that  y is not restricted to  be either 0 or 1.</p>
<p dir="auto">Multilabel <code class="notranslate">Y</code> is currently represented as a 2d <code class="notranslate">np.ndarray</code> or <code class="notranslate">scipy.sparse</code> matrix of binary indicators. We explicitly forbid a list of lists or list of arrays, even if it represents the same binary indicators, in <code class="notranslate">sklearn.utils.multiclass.type_of_target</code> etc. This prohibition is for legacy reasons (lists of lists used to indicate multilabel data with different semantics) and we should be able to safely support non-array array-likes as multilabel representations.</p>
<p dir="auto">Everywhere that multilabel is supported (metrics, estimators), this format should be too.</p>
<p dir="auto">Derived from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="120380314" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/5959" data-hovercard-type="issue" data-hovercard-url="/scikit-learn/scikit-learn/issues/5959/hovercard" href="https://github.com/scikit-learn/scikit-learn/issues/5959">#5959</a>.</p>