-
Notifications
You must be signed in to change notification settings - Fork 14
/
server.py
33 lines (24 loc) · 823 Bytes
/
server.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
from flask import Flask,request
import util
app = Flask(__name__)
@app.route('/get_feature_names')
def get_feature_names():
response = {'Features' : util.show_feature_names()}
return response
@app.route('/predict_car_price',methods=['POST'])
def predict_car_price():
age = request.form['Age']
kms = request.form['Kms']
mlg = request.form['Mileage']
engine = request.form['Engine']
pwr = request.form['Power']
sts = request.form['Seats']
own = request.form['Owner']
trans = request.form['Transmission']
fuel = request.form['Fuel']
city = request.form['City']
car = request.form['Car']
response = {'Price' : util.predict_price(age,kms,mlg,engine,pwr,
sts,own,trans,fuel,city,car)}
return response
app.run()