Fix nan issue in features
[trackerpp.git] / python / predictor.py
index 9f21518..0e8f026 100644 (file)
@@ -12,18 +12,22 @@ def init(fname = './model.pkl'):
     f = open(fname, 'rb')
     predictors = pickle.load(f)
     f.close()
+    return True;
 
 def dump():
     global predictors
+    ss = '\n'
     for i in predictors:
-        print i
-        print i.coef_
+        ss += str(i.__dict__)
+        ss += '\n'
+    return ss
 
 
 def predict(index, features):
     pp = predictors[index]
     true_class = int(pp.classes_[1] == 1)
     prob = pp.predict_proba([features])[0, true_class]
+    print prob
     return prob