<p dir="auto">SVC's and LinearSVC's (I didn't check other classifiers) decision_function in binary classification case returns values lower than 0 when predict returns 0, and &gt;0 when predict returns 1.<br>
So this part of code is wrong:</p>
<p dir="auto">pred = estimators[k].predict(X)<br>
score = _predict_binary(estimators[k], X)<br>
scores[:, i] += score<br>
scores[:, j] -= score<br>
votes[pred == 0, i] += 1<br>
votes[pred == 1, j] += 1</p>
<p dir="auto">In SVM case we should substract score from scores[:,i] and add to scores[:,j]</p>
<p dir="auto">In multiclass.py, function predict_ovo(estimators, classes, X), it has:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="       scores[:, i] += score
       scores[:, j]  -= score"><pre class="notranslate"><code class="notranslate">       scores[:, i] += score
       scores[:, j]  -= score
</code></pre></div>
<p dir="auto">However, I think it should be:<br>
scores[:, i]   -= score<br>
scores[:, j]  += score</p>
<p dir="auto">I think the idea here should be, when score &gt; 0, the positive class increase its value in 'scores by' 'score', and the negative class decrease its value by 'score'. Because in case of tie, we use 'argmax(scores)' to determine the class, so the 'scores' should represent 'how certain we are about the class'. Therefore in the original code, 'i' should represent the positive class while 'j' represents the negative class.</p>
<p dir="auto">Since from 'pred' and 'score' you find out: when score is positive, it has the label of '1' and otherwise '0', it means '1' is the positive class label and '0' is the negative class label.</p>
<p dir="auto">However, in _fit_ovo_binary(estimator, X, y, i, j), with 'i' and 'j' being the same as used in predict_ovo(estimators, classes, X):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="y[y == i] = 0
y[y == j] = 1"><pre class="notranslate"><code class="notranslate">y[y == i] = 0
y[y == j] = 1
</code></pre></div>
<p dir="auto">We know that 'i' &lt; 'j'. Since 1 is the positive class label, then 'j' represent the positive class. i.e. for a classifier trained between 'i' and 'j' with  'i' &lt; 'j', 'j' is the positive class.</p>
<p dir="auto">Back to function predict_ovo(estimators, classes, X), we see from line:<br>
scores[:, j]  -= score</p>
<p dir="auto">If score &gt; 0, we decrease the value corresponding to class 'j', which is incorrect.</p>
<p dir="auto">Hope it is not too verbose.</p>