def api_get_predictions(): count = request.args.get('count', 50) crime_set = get_crimes(count) predictions = predict_crime(crime_set) return json.dumps([p.__serialize__() for p in predictions])
def api_get_crimes(): count = request.args.get('count', 50) return json.dumps([c.__serialize__() for c in get_crimes(count)])