From e1eece4ded0d6709fa0398e6347c8b10ea2a7dbd Mon Sep 17 00:00:00 2001 From: Tiago Katcipis Date: Thu, 14 Dec 2017 20:03:31 -0200 Subject: [PATCH 1/2] Add log when saving model file --- svm-train.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/svm-train.c b/svm-train.c index 716815b4..02b68dc7 100644 --- a/svm-train.c +++ b/svm-train.c @@ -103,11 +103,13 @@ int main(int argc, char **argv) else { model = svm_train(&prob,¶m); + fprintf(stdout, "saving model to file %s\n", model_file_name); if(svm_save_model(model_file_name,model)) { fprintf(stderr, "can't save model to file %s\n", model_file_name); exit(1); } + fprintf(stdout, "saved model to file %s with success\n", model_file_name); svm_free_and_destroy_model(&model); } svm_destroy_param(¶m); From f01f6f9ab5a8c75c4ceee278a0d029c1fbfade4a Mon Sep 17 00:00:00 2001 From: Tiago Katcipis Date: Thu, 14 Dec 2017 20:12:08 -0200 Subject: [PATCH 2/2] Improve output --- svm-train.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/svm-train.c b/svm-train.c index 02b68dc7..2f04116b 100644 --- a/svm-train.c +++ b/svm-train.c @@ -98,18 +98,20 @@ int main(int argc, char **argv) if(cross_validation) { + fprintf(stdout, "performing cross validation\n"); do_cross_validation(); } else { + fprintf(stdout, "training model\n"); model = svm_train(&prob,¶m); - fprintf(stdout, "saving model to file %s\n", model_file_name); + fprintf(stdout, "trained model, saving in file[%s]\n", model_file_name); if(svm_save_model(model_file_name,model)) { - fprintf(stderr, "can't save model to file %s\n", model_file_name); + fprintf(stderr, "can't save model to file[%s]\n", model_file_name); exit(1); } - fprintf(stdout, "saved model to file %s with success\n", model_file_name); + fprintf(stdout, "saved model with success\n"); svm_free_and_destroy_model(&model); } svm_destroy_param(¶m);