amueller/scikit-learn — comment on commit 658897497399147a78fad5f7001fc62dd1e487ed
File: sklearn/svm/base.py line 153
By mblondel:

I don't have any reference, this is just an intuition. So, to make a prediction with one-vs-one, you need to compute the score of each class. For example, with 3 classes and 4 SV:

score_1_vs_2 = alpha_1_vs_2_1 * k(x, sv1) + ... + alpha_1_vs_2_4 * k(x, sv4)
score_1_vs_3 = alpha_1_vs_3_1 * k(x, sv1) + ... + alpha_1_vs_3_4 * k(x, sv4)
score_c1 = score_1_vs_2 + score_1_vs_3
score_c1 = (alpha_1_vs_2_1 + alpha_1_vs_3_1) k(x, sv1) + ... + (alpha_1_vs_2_1 + alpha_1_vs_3_1) k(x, sv4)

By posing `alpha_c1_1 = (alpha_1_vs_2_1 + alpha_1_vs_3_1)`, you obtain the coefficient of class1 with respect to sv1. This is very similar to one-vs-rest. And you can precompute `alpha_c1_1` at fit time. I haven't checked if this is what is happening in libsvm though.