Sfoglia il codice sorgente

Added round() to results instead of ingeter cast.

Taddeus Kroes 14 anni fa
parent
commit
f2678488c2
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      src/find_svm_params.py

+ 2 - 2
src/find_svm_params.py

@@ -30,7 +30,7 @@ for c in C:
         results.append(result)
         i += 1
         print '%d of %d, c = %f, gamma = %f, result = %d%%' \
-              % (i, len(C) * len(Y), c, y, int(result * 100))
+              % (i, len(C) * len(Y), c, y, int(round(result * 100)))
 
 i = 0
 
@@ -44,7 +44,7 @@ for c in C:
     print ' %7s' % c,
 
     for y in Y:
-        print '| %8d' % int(results[i] * 100),
+        print '| %8d' % int(round(results[i] * 100)),
         i += 1
 
     print