-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterface.py
34 lines (24 loc) · 917 Bytes
/
interface.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from flask import Flask,request,jsonify,render_template
from project_app.utils import MarketValuePredict
app = Flask(__name__)
@app.route("/")
def home_api():
return render_template("index.html")
@app.route("/predict")
def predict():
data = request.form
club = data["club"]
position = data["position"]
page_views = data["page_views"]
fpl_value = data["fpl_value"]
fpl_sel = data["fpl_sel"]
fpl_points = data["fpl_points"]
region = data["region"]
new_foreign = data["new_foreign"]
age_cat = data["age_cat"]
big_club = data["big_club"]
new_signing = data["new_signing"]
model = MarketValuePredict(club,position,page_views,fpl_value,fpl_sel,fpl_points,region,new_foreign,age_cat,big_club,new_signing)
prediction_result = model.predict_mv()
return jsonify({"Predicted Market value":prediction_result})
app.run(debug = True)