Why is Multi-label classification (Binary relevance) is acting up?
<p>I'm new to multi-label classification using Binary Relevance and having some issues explaining the result:</p>

<p>The result is:
    [[ 0.  0.]
     [ 2.  2.]]</p>

<p>Does it mean that the first case is classified [0,0] and the 2nd is [2,2]? That does not look good at all. Or am I missing something else? </p>

<p>After the gentelmen answers now I'm getting the following error 
because of the y_train label [2**,0,**3,4] because of the zero</p>

<pre><code>Traceback (most recent call last):
File "driver.py", line 22, in &lt;module&gt;
clf_dict[i] = clf.fit(x_train, y_tmp)
File "C:\Users\BaderEX\Anaconda22\lib\site-packages\sklearn\linear_model\logistic.py", line 1154, in fit
self.max_iter, self.tol, self.random_state)
File "C:\Users\BaderEX\Anaconda22\lib\site-packages\sklearn\svm\base.py", line 885, in _fit_liblinear
" class: %r" % classes_[0])
ValueError: This solver needs samples of at least 2 classes in the data, but the data contains only one class: 1
</code></pre>

<p>Updated code:</p>

<pre><code>import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import *

numer_classes = 5

x_train = np.array([[1,2,3,4],[0,1,2,1],[1,2,0,3]])
y_train = [[0],[1,0,3],[2,0,3,4]]

x_test = np.array([[1,2,3,4],[0,1,2,1],[1,2,0,3]])
y_test = [[0],[1,0,3],[2,0,3,4]]

clf_dict = {}
for i in range(numer_classes):
    y_tmp = []
    for j in range(len(y_train)):
        if i in y_train[j]:
            y_tmp.append(1)
        else:
            y_tmp.append(0)
    clf = LogisticRegression()
    clf_dict[i] = clf.fit(x_train, y_tmp)

prediction_matrix = np.zeros((len(x_test),numer_classes))
for i in range(numer_classes):
    prediction = clf_dict[i].predict(x_test)
    prediction_matrix[:,i] = prediction    

print('Predicted')
print(prediction_matrix)
</code></pre>

<p>Thanks</p>