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.54k stars 1.64k forks source link

What value should the class label be in regression? #114

Closed BramVanroy closed 6 years ago

BramVanroy commented 6 years ago

In the README it says:

However, we found that the label doesn't need to be an integer on Linux, as it also works if you use a string. For instance, using UNK (from unknown) works - but not on Windows.

To ensure a similar experience across operating systems, which default value is encouraged? Documentation says 'any integer', so can I just use 0?

cjlin1 commented 6 years ago

To train regression you must put a target value there.

Bram Vanroy writes:

In the README it says:

: : ...
.
.
.

Each line contains an instance and is ended by a '\n'
character. For
classification, is an integer indicating the class label
(multi-class is supported). For regression, is the target
value which can be any real number.

However, we found that the label doesn't need to be an integer on Linux, as it also works if you use a string. For instance, using UNK (from unknown) works - but not on Windows.

To ensure a similar experience across operating systems, which default value is encouraged? Documentation says 'any integer', so can I just use 0?

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

BramVanroy commented 6 years ago

But the target value is unknown, right? It's the one you are trying to predict.

cjlin1 commented 6 years ago

for prediction any value is ok Bram Vanroy writes:

But the target value is unknown, right? It's the one you are trying to predict.

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

BramVanroy commented 6 years ago

So just using something like the following, where the label is 0 is okay?

0 1:4.458333333333333 2:24.0 3:0.20833333333333334 4:8.333333333333334 5:29.166666666666668 6:87.5 8:1.0

cjlin1 commented 6 years ago

yes Bram Vanroy writes:

So just using something like the following, where the label is 0 is okay?

0 1:4.458333333333333 2:24.0 3:0.20833333333333334 4:8.333333333333334 5:29.166666666666668 6:87.5 8:1.0

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