litianqi715 / librf

Automatically exported from code.google.com/p/librf
Other
0 stars 0 forks source link

csv and libsvm examples give different results #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
CSV:

./rftrain -t 100 -m heart.model -d ../data/heart.csv --header --csv -l 
../data/heart_labels.txt
OOB Accuracy 0.825926
---Confusion Matrix----
94 26 
21 129 
Reliability Diagram
bin fraction 1 0 total
0.05 0.04 2 48 50
0.15 0.0833333 3 33 36
0.25 0.347826 8 15 23
0.35 0.25 6 18 24
0.45 0.318182 7 15 22
0.55 0.55 11 9 20
0.65 0.722222 13 5 18
0.75 0.785714 11 3 14
0.85 0.96 24 1 25
0.95 0.921053 35 3 38
Model file saved to heart.model

libSVM:
./rftrain -t 100 -m heart.model -d ../data/heart.svm -f 14
OOB Accuracy -nan
---Confusion Matrix----
0 0 
0 0 
Reliability Diagram
bin fraction 1 0 total
0.05 -nan -2147483648 -2147483648 0
0.15 -nan -2147483648 -2147483648 0
0.25 -nan -2147483648 -2147483648 0
0.35 -nan -2147483648 -2147483648 0
0.45 -nan -2147483648 -2147483648 0
0.55 -nan -2147483648 -2147483648 0
0.65 -nan -2147483648 -2147483648 0
0.75 -nan -2147483648 -2147483648 0
0.85 -nan -2147483648 -2147483648 0
0.95 -nan -2147483648 -2147483648 0
Model file saved to heart.model

On Ubuntu 12.04 using librf release.

Cheers,
Tim

Original issue reported on code.google.com by timnug...@gmail.com on 23 Mar 2013 at 4:29

GoogleCodeExporter commented 9 years ago
Fixed by uncommenting some lines in rf-train.cc:

    if (!csv) {
      set = InstanceSet::load_libsvm(datafile, num_features);
    } else {
      if (!unsupervised) {
        set = InstanceSet::load_csv_and_labels(datafile, labelfile, header, delim);
        set_size = set->size();
      } else {
        set = InstanceSet::load_unsupervised(datafile, &seed, header, delim);
        set_size = set->size() / 2;
      }
    }

Original comment by timnug...@gmail.com on 25 Apr 2013 at 3:40

GoogleCodeExporter commented 9 years ago
I have one file but its format is in csv file. I want to use libsvm through 
command line.which format should I prefer if I want to run my dataset by 
CommandLine?
plz guide me

Original comment by ProjectM...@gmail.com on 31 Jan 2014 at 8:30