Skip to content

Commit f0a1eb6

Browse files
committed
change input
1 parent d40c480 commit f0a1eb6

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

app/__init__.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,14 @@
1010

1111
@app.route('/test', methods=['GET'])
1212
def getResult():
13-
input = np.array([[5.5, 2.4, 2.7, 1.]])
14-
result = model.predict(input)
13+
result = 1
1514
return jsonify({'result': str(result)})
1615

1716
@app.route('/predict', methods=['POST'])
1817
def postInput():
1918
# 取得前端傳過來的數值
2019
insertValues = request.get_json()
21-
x1=insertValues['sepalLengthCm']
22-
x2=insertValues['sepalWidthCm']
23-
x3=insertValues['petalLengthCm']
24-
x4=insertValues['petalWidthCm']
25-
input = np.array([[x1, x2, x3, x4]])
20+
x1=insertValues['userID']
2621
# 進行預測
27-
result = model.predict(input)
28-
22+
result = x1+1
2923
return jsonify({'result': str(result)})

0 commit comments

Comments
 (0)