-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
22 lines (17 loc) · 842 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from flask import *
import pickle
app = Flask(__name__)
with open(r"C:\Users\j\Desktop\projects\project 1\Real Estate GUI\house_price.pickle", 'rb') as f:
model = pickle.load(f)
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
sqft = int(request.form['sqft'])
bedroom = int(request.form['bedroom'])
bathroom = int(request.form['bathroom'])
result = round(model.predict([[sqft, bedroom, bathroom]])[0])
# return f"User Input: Sqaure Feet - {name}, Bedroom - {age}, Bathroom - {location} is {model.predict([[name, age, location]])[0]}"
return render_template('index.html',sqft=sqft, bedroom=bedroom, bathroom=bathroom, model = result)
return render_template('index.html')
if __name__ == '__main__':
app.run(debug=True)