Skip to content

Instantly share code, notes, and snippets.

@naoh16
Created March 19, 2012 10:12
Show Gist options
  • Save naoh16/2106383 to your computer and use it in GitHub Desktop.
Save naoh16/2106383 to your computer and use it in GitHub Desktop.
Print label and dec_value for LIBLINEAR 1.8
*** predict.c 2011-02-05 21:21:49.000000000 +0900
--- predict2.c 2012-03-19 19:08:41.905910501 +0900
***************
*** 138,145 ****
}
else
{
! predict_label = predict(model_,x);
! fprintf(output,"%d\n",predict_label);
}
if(predict_label == target_label)
--- 138,151 ----
}
else
{
! //predict_label = predict(model_,x);
! double *dec_values = (double *) malloc(sizeof(double) * model_->nr_class);
! predict_label = predict_values(model_, x, dec_values);
!
! //fprintf(output,"%d\n",predict_label);
! fprintf(output, "%d %f\n", predict_label, dec_values[0]*model_->label[0]);
!
! free(dec_values);
}
if(predict_label == target_label)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment