forked from urbanguac/moose
-
Notifications
You must be signed in to change notification settings - Fork 10
/
test.py
33 lines (29 loc) · 983 Bytes
/
test.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, render_template, request
import neuralnet.predict as pr
from console_logging.console import Console
console = Console()
app=Flask(__name__)
@app.route('/predict', methods=['POST'])
def predict():
# get form variables and type them
gpa = float(request.form["gpa"])
score = int(request.form["test_score"])
console.info("Chancing GPA: %d, SAT: %d"%(gpa,score))
predictions=[]
#TODO: implement test type. This is a stub.
if score<=36:
predictions=pr.predict(gpa,score,"ACT")
elif score<=1600:
predictions=pr.predict(gpa,score,"SAT1600")
else:
predictions = pr.predict(gpa,score,"SAT2400")
##
if predictions[0]==1:
return "Admission is likely."
else:
if predictions[0]==0:
return "Admission is unlikely."
return "Something went wrong."
@app.route('/')
def home():
return render_template('website.html', college={'name':'CMU','accuracy':'78.6517'})