X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=python%2Fpredictor.py;h=0e8f026093dc06ae0e20f75cb4ba4a58636e13a1;hb=97b147e9106cb549dd7dd62829b9d29b326738c7;hp=b58fd41a360311ac0b47753003f722fc4ca18d87;hpb=3ff9a5ad691b8dca9d91f8e9786a8d08d31b70fa;p=trackerpp.git diff --git a/python/predictor.py b/python/predictor.py index b58fd41..0e8f026 100644 --- a/python/predictor.py +++ b/python/predictor.py @@ -12,6 +12,7 @@ def init(fname = './model.pkl'): f = open(fname, 'rb') predictors = pickle.load(f) f.close() + return True; def dump(): global predictors @@ -19,8 +20,6 @@ def dump(): for i in predictors: ss += str(i.__dict__) ss += '\n' -# ss += str(i.coef_) -# ss += '\n' return ss @@ -28,6 +27,7 @@ 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