From 9c4f72cc94ba8de5a425ba0261265c44804ab2f3 Mon Sep 17 00:00:00 2001 From: AmyOlex Date: Sun, 26 Aug 2018 15:04:59 -0400 Subject: [PATCH] Fixing SVM Issue #32. There were two area that called the ML modules. The first around line 61 was edited correctly, but the second around line 106 was missed. I corrected the problem by copying the code from the first instance to the second. This only seemed to be an issue with the evaluation dataset. --- Chrono/TimePhraseToChrono/PeriodInterval.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Chrono/TimePhraseToChrono/PeriodInterval.py b/Chrono/TimePhraseToChrono/PeriodInterval.py index 89bfb3eb..e60791a6 100644 --- a/Chrono/TimePhraseToChrono/PeriodInterval.py +++ b/Chrono/TimePhraseToChrono/PeriodInterval.py @@ -205,6 +205,9 @@ def buildPeriodInterval(s, chrono_id, chrono_list, ref_list, classifier, feats): if(classifier[1] == "NN"): my_class = ChronoKeras.keras_classify(classifier[0], np.array(list(my_features.values()))) #print("Class: " + str(my_class) + " : Start: " + str(abs_Sspan) + " : End: "+ str(abs_Espan)) + elif classifier[1] in ("SVM", "RF"): + feat_array = [int(i) for i in my_features.values()] + my_class = classifier[0].predict([feat_array])[0] else: my_class = classifier[0].classify(my_features) #print("Class: " + str(my_class) + " : Start: " + str(abs_Sspan) + " : End: "+ str(abs_Espan))