def svm_predict_from_file(proba=False, n_predict=5, isDecision=False): start = time.time() with open(model_file,"rb") as handle: svmManager = SvmManager(handle, verbose=verbose, isSgd=True, proba=proba) svmManager.load() if not proba: result = svmManager.predict(test_points) elif not isDecision: result = svmManager.predict_proba(test_points, n_predict) else: result = svmManager.decision_function(test_points, n_predict) end = time.time() logging.info("testing predict from file finished in {0}s with {1}".format(end - start, model_file)) print("[RESULT LENGTH]", len(result)) return result