-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
33 lines (23 loc) · 917 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
23
24
25
26
27
28
29
30
31
32
33
import pandas as pd
from flask import Flask, request, jsonify, render_template
import pickle
app = Flask(__name__)
model = pickle.load(open('regressor.pkl', 'rb'))
@app.route('/')
def home():
return render_template('index.html')
@app.route('/predict', methods=['GET','post'])
def predict():
GRE_Score = int(request.form['GRE Score'])
TOEFL_Score = int(request.form['TOEFL Score'])
University_Rating = int(request.form['University Rating'])
SOP = float(request.form['SOP'])
LOR = float(request.form['LOR'])
CGPA = float(request.form['CGPA'])
Research = int(request.form['Research'])
final_features = pd.DataFrame([[GRE_Score, TOEFL_Score, University_Rating, SOP, LOR, CGPA, Research]])
predict = model.predict(final_features)
output = predict[0]
return render_template('index.html', prediction_text='Admission chances are {}'.format(output))
if __name__ == "__main__":
app.run(debug=True)