cjlin1 / libsvm

LIBSVM -- A Library for Support Vector Machines
https://www.csie.ntu.edu.tw/~cjlin/libsvm/
BSD 3-Clause "New" or "Revised" License
4.55k stars 1.64k forks source link

No tie-breaking in one-vs-one #85

Closed amueller closed 5 years ago

amueller commented 7 years ago

The prediction from one-vs-one is done here: https://github.com/cjlin1/libsvm/blob/master/svm.cpp#L2565

And there is no tie-breaking, and in case of a tie, it always predicts 0. I'm not sure if there is a standard tie-breaking mechanism, but deterministically predicting 0 seems like an odd choice. Is there something I'm missing?

cjlin1 commented 7 years ago

See the 2nd last paragraph of Sec 7 in libsvm paper Andreas Mueller writes:

The prediction from one-vs-one is done here: https://github.com/cjlin1/libsvm/blob/master/svm.cpp#L2565

And there is no tie-breaking, and in case of a tie, it always predicts 0. I'm not sure if there is a standard tie-breaking mechanism, but deterministically predicting 0 seems like an odd choice. Is there something I'm missing?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.*

amueller commented 7 years ago

Have you thought about this further? This doesn't seem to be an edge case to me, for example for three classes.

Sent from phone. Please excuse spelling and brevity.

On Feb 2, 2017 9:43 PM, "cjlin1" notifications@github.com wrote:

See the 2nd last paragraph of Sec 7 in libsvm paper Andreas Mueller writes:

The prediction from one-vs-one is done here: https://github.com/cjlin1/libsvm/blob/master/svm.cpp#L2565

And there is no tie-breaking, and in case of a tie, it always predicts 0. I'm not sure if there is a standard tie-breaking mechanism, but deterministically predicting 0 seems like an odd choice. Is there something I'm missing?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.*

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cjlin1/libsvm/issues/85#issuecomment-277150163, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbcFqToBJ-NTWlVcJ3Wgb3CJ2QW_oidks5rYpQzgaJpZM4L1y3P .

amueller commented 7 years ago

Also thank you for your quick reply!

Sent from phone. Please excuse spelling and brevity.

On Feb 2, 2017 9:50 PM, "Andreas Mueller" t3kcit@gmail.com wrote:

Have you thought about this further? This doesn't seem to be an edge case to me, for example for three classes.

Sent from phone. Please excuse spelling and brevity.

On Feb 2, 2017 9:43 PM, "cjlin1" notifications@github.com wrote:

See the 2nd last paragraph of Sec 7 in libsvm paper Andreas Mueller writes:

The prediction from one-vs-one is done here: https://github.com/cjlin1/libsvm/blob/master/svm.cpp#L2565

And there is no tie-breaking, and in case of a tie, it always predicts 0. I'm not sure if there is a standard tie-breaking mechanism, but deterministically predicting 0 seems like an odd choice. Is there something I'm missing?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.*

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cjlin1/libsvm/issues/85#issuecomment-277150163, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbcFqToBJ-NTWlVcJ3Wgb3CJ2QW_oidks5rYpQzgaJpZM4L1y3P .

cjlin1 commented 7 years ago

we can consider decision values. However, so far we haven't found real cases where ties occur too often. So the implementation for handling this may not be cost-effective Andreas Mueller writes:

Have you thought about this further? This doesn't seem to be an edge case to me, for example for three classes.

Sent from phone. Please excuse spelling and brevity.

On Feb 2, 2017 9:43 PM, "cjlin1" notifications@github.com wrote:

See the 2nd last paragraph of Sec 7 in libsvm paper Andreas Mueller writes:

The prediction from one-vs-one is done here:

https://github.com/cjlin1/libsvm/blob/master/svm.cpp#L2565

And there is no tie-breaking, and in case of a tie, it always predicts 0. I'm not sure if there is a standard tie-breaking mechanism, but deterministically predicting 0 seems like an odd choice. Is there something I'm missing?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.*

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub

https://github.com/cjlin1/libsvm/issues/85#issuecomment-277150163 ;, or mute the thread

https://github.com/notifications/unsubscribe-auth/AAbcFqToBJ-NTWlVcJ3Wgb3CJ2QW_oidks5rYpQzgaJpZM4L1y3P ; .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.*