-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
36 lines (27 loc) · 898 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
34
35
36
-from flask import Flask, render_template, request
import pickle
import numpy as np
import warnings
warnings.filterwarnings("ignore")
model = pickle.load(open('alzheimer2.pkl', 'rb'))
app = Flask(__name__)
@app.route('/')
def man():
return render_template('home.html')
@app.route('/predict', methods=['POST'])
def home():
data1 = request.form['M/F']
data2 = request.form['Age']
data3 = request.form['EDUC']
data4 = request.form['SES']
data5 = request.form['MMSE']
data6 = request.form['CDR']
data7 = request.form['nWBV']
data8 = request.form['ASF']
data9 = request.form['eTIV']
arr = np.array([[data1, data2, data3, data4, data5, data6, data7, data8, data9]])
print(arr)
pred = model.predict(arr)
return render_template('result.html', data=pred)
if __name__ == "__main__":
app.run(debug=True)