]> granicus.if.org Git - liblinear/commitdiff
Print more digit of predicted labels (%.17g) as more accurate target values may be...
authorChih-Jen Lin <cjlin@csie.ntu.edu.tw>
Sat, 30 Jun 2018 00:04:32 +0000 (08:04 +0800)
committerChih-Jen Lin <cjlin@csie.ntu.edu.tw>
Sat, 30 Jun 2018 00:04:32 +0000 (08:04 +0800)
matlab/libsvmwrite.c
predict.c

index 3c59178854fab43c45ece5300b7a0dafba414241..b077d382f43c728655515833a776574a1a1eed02 100644 (file)
@@ -68,7 +68,7 @@ void libsvmwrite(const char *filename, const mxArray *label_vec, const mxArray *
 
        for(i=0;i<l;i++)
        {
-               fprintf(fp,"%g", labels[i]);
+               fprintf(fp,"%.17g", labels[i]);
 
                low = jc[i], high = jc[i+1];
                for(k=low;k<high;k++)
index a0431811c004900883d7f273f3d21d41cf6be0c5..8f415d27751255423d58e1342065814f48b6c23e 100644 (file)
--- a/predict.c
+++ b/predict.c
@@ -145,7 +145,7 @@ void do_predict(FILE *input, FILE *output)
                else
                {
                        predict_label = predict(model_,x);
-                       fprintf(output,"%g\n",predict_label);
+                       fprintf(output,"%.17g\n",predict_label);
                }
 
                if(predict_label == target_label)