From bb7d69941cbce4f67f10406395d685ea92be9478 Mon Sep 17 00:00:00 2001 From: AlexeyAB Date: Mon, 21 Oct 2019 15:49:46 +0300 Subject: [PATCH] Added debugging info for Training Classifier for case: Too many or too few labels --- src/data.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/data.c b/src/data.c index d8f0c9e8..7cb7bf0a 100644 --- a/src/data.c +++ b/src/data.c @@ -498,7 +498,16 @@ void fill_truth(char *path, char **labels, int k, float *truth) ++count; } } - if(count != 1) printf("Too many or too few labels: %d, %s\n", count, path); + if (count != 1) { + printf("Too many or too few labels: %d, %s\n", count, path); + count = 0; + for (i = 0; i < k; ++i) { + if (strstr(path, labels[i])) { + printf("\t label %d: %s \n", count, labels[i]); + count++; + } + } + } } void fill_hierarchy(float *truth, int k, tree *hierarchy)