2

I am new to machine learning and I am trying to use logistic regression prediction in liblinear using dataset from here http://www.ats.ucla.edu/stat/data/binary.csv

I am using java to train and test. However even if I run the prediction on the same file, I always get -1 as the prediction for all of them. I never get 100% even if I use the heart_scale provided with lib linear and libsvm. What I am doing wrong?

I am running the following commands in java

java -cp liblinear-1.94.jar de.bwaldvogel.liblinear.Train -s 0 trainFile

java -cp liblinear-1.94.jar de.bwaldvogel.liblinear.Predict -b 1 testFile testFile.model testFile.txt

user3312156
  • 153
  • 1
  • 1
  • 8
  • can you show us some instance of the trainFile data, which is directly used in the Train process – michaeltang Feb 15 '14 at 01:33
  • Yea sure, I first tried with heart_scale which is provided with libsvm & liblinear. Even if I used the same file i.e. heart_scale I still don't get 100% accuracy. I then tried with http://www.ats.ucla.edu/stat/data/binary.csv with which lib linear is only predicting -1 for all. Sample from heart_scale +1 1:0.708333 2:1 3:1 4:-0.320755 5:-0.105023 6:-1 7:1 8:-0.419847 9:-1 10:-0.225806 12:1 13:-1 -1 1:0.583333 2:-1 3:0.333333 4:-0.603774 5:1 6:-1 7:1 8:0.358779 9:-1 10:-0.483871 12:-1 13:1 – user3312156 Feb 16 '14 at 01:48
  • surely, you cannot get 100% accuracy by heart_scale, I am afraid when you are tesing with from http://www.ats.ucla.edu/stat/data/binary.csv did you format it as the way heart_scale is – michaeltang Feb 17 '14 at 01:36

0 Answers0