Sfoglia il codice sorgente

Added CSV generation

Kristian Schultz 4 anni fa
parent
commit
640c32ea86
2 ha cambiato i file con 10 aggiunte e 14 eliminazioni
  1. 4 8
      Example Exercise.ipynb
  2. 6 6
      library/testers.py

File diff suppressed because it is too large
+ 4 - 8
Example Exercise.ipynb


+ 6 - 6
library/testers.py

@@ -57,7 +57,7 @@ class TestResult:
         return text
 
 
-    def csvHeading():
+    def csvHeading(self):
         r = [
             "F1 score",
             "balanced accuracy",
@@ -68,22 +68,22 @@ class TestResult:
             ]
 
         if self.aps is not None:
-            r.append(self.aps)
+            r.append("Aps")
 
         return ";".join(r)
 
-    def toCSV():
-        r = [
+    def toCSV(self):
+        r = map(str, [
             self.f1,
             self.bal_acc,
             self.con_mat[0] if len(self.con_mat) > 0 else float(self.con_mat),
             self.con_mat[1] if len(self.con_mat) > 1 else 0,
             self.con_mat[2] if len(self.con_mat) > 2 else 0,
             self.con_mat[3] if len(self.con_mat) > 3 else 0
-            ]
+            ])
 
         if self.aps is not None:
-            r.append(self.aps)
+            r.append(str(self.aps))
 
         return ";".join(r)
 

Some files were not shown because too many files changed in this diff