From 2bed8a7170c8694d8a582544203af67ff98a933e Mon Sep 17 00:00:00 2001 From: Awantik Das Date: Mon, 25 Nov 2019 17:06:25 +0530 Subject: [PATCH] Add files via upload --- flask_ml_api.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 flask_ml_api.py diff --git a/flask_ml_api.py b/flask_ml_api.py new file mode 100644 index 0000000..3ab1cdb --- /dev/null +++ b/flask_ml_api.py @@ -0,0 +1,19 @@ +#!flask/bin/python +from flask import Flask, jsonify, request +import joblib +import pandas as pd + +app = Flask(__name__) + +@app.route('/predict/tx', methods=['GET']) +def create_task(): + tx_data = request.json + #model = joblib.load('model0.pipeline') + model.predict([[]]) + #tx_data['P'] = model.best_estimator_.predict(df)[0] + #cwd.write_json_table(tx_data) + #tx_data['P'] = str(tx_data['P']) + return jsonify("Hello World"), 201 + +if __name__ == '__main__': + app.run(debug=True)