Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

liblinear gives very different regression results compared with libsvm #20

Open
simsong opened this issue Jan 22, 2018 · 1 comment
Open

Comments

@simsong
Copy link

simsong commented Jan 22, 2018

From @CooledCoffee on March 18, 2015 3:32

Procedures

  1. Using the simple regression dataset provided by libsvm http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/regression.html#eunite2001.
  2. Train & predict using both libsvm & liblinear

svm-train -s 3 -t 0 -c 1 -p 0.1 -e 0.001 -h 0 eunite2001 model.1 && svm-predict eunite2001.t model.1 prediction.1

liblinear-train -s 11 -c 1 -p 0.1 -e 0.001 eunite2001 model.11 && liblinear-predict eunite2001.t model.11 prediction.11

liblinear-train -s 12 -c 1 -p 0.1 -e 0.001 eunite2001 model.12 && liblinear-predict eunite2001.t model.12 prediction.12

liblinear-train -s 13 -c 1 -p 0.1 -e 0.001 eunite2001 model.13 && liblinear-predict eunite2001.t model.13 prediction.13
3. The results are here:

libsvm liblinear -s 11 liblinear -s 12 liblinear -s 13
754.219 711.818 714.293 655.209
735.951 695.675 703.196 651.262
745.716 606.048 601.496 628.192
756.885 721.134 721.481 652.914
758.048 704.657 705.966 644.363
758.296 703.099 703.878 644.147
756.88 680.706 688.226 629.164
753.174 681.003 682.531 631.114
733.147 666.063 668.37 617.042
743.909 606.234 599.665 605.601
... ... ... ...

Questions

  1. To my understanding, "liblinear-train -s 13" is the best match for "svm-train -s 3 -t 0". Is that correct?
  2. Why are the results so different? In general, which tool gives better result?

Copied from original issue: cjlin1#10

@simsong
Copy link
Author

simsong commented Jan 22, 2018

From @cjlin1 on March 18, 2015 13:28

-s 11 and -s 12 should give you same (or almost the same) results
if you use a smaller -e.
Regarding libsvm and liblinear their formulations are slightly
different. In liblinear by default there is no bias term.
Also for libsvm you want to make sure you are using linear kernel
for this comparison
CooledCoffee writes:

Procedures

  1. Using the simple regression dataset provided by libsvm http://
    www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/regression.html#
    eunite2001.
  2. Train & predict using both libsvm & liblinear

svm-train -s 3 -t 0 -c 1 -p 0.1 -e 0.001 -h 0 eunite2001 model.1 &&
svm-predict eunite2001.t model.1 prediction.1

liblinear-train -s 11 -c 1 -p 0.1 -e 0.001 eunite2001 model.11 &&
liblinear-predict eunite2001.t model.11 prediction.11

liblinear-train -s 12 -c 1 -p 0.1 -e 0.001 eunite2001 model.12 &&
liblinear-predict eunite2001.t model.12 prediction.12

liblinear-train -s 13 -c 1 -p 0.1 -e 0.001 eunite2001 model.13 &&
liblinear-predict eunite2001.t model.13 prediction.13
3. The results are here:

libsvm liblinear -s 11 liblinear -s 12 liblinear -s 13
754.219 711.818 714.293 655.209
735.951 695.675 703.196 651.262
745.716 606.048 601.496 628.192
756.885 721.134 721.481 652.914
758.048 704.657 705.966 644.363
758.296 703.099 703.878 644.147
756.88 680.706 688.226 629.164
753.174 681.003 682.531 631.114
733.147 666.063 668.37 617.042
743.909 606.234 599.665 605.601
... ... ... ...

Questions

  1. To my understanding, "liblinear-train -s 13" is the best match for
    "svm-train -s 3 -t 0". Is that correct?
  2. Why are the results so different? In general, which tool gives better
    result?


Reply to this email directly or view it on GitHub.*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant