-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpredict_test.py
40 lines (30 loc) · 972 Bytes
/
predict_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
34
35
36
37
38
39
40
#!/usr/bin/env python
# coding: utf-8
import pandas as pd
import requests
# host = "fungi-classifier.eba-rpcwcrqg.eu-central-1.elasticbeanstalk.com" # AWS Elastic Beanstalk (remote)
# host = "18.199.224.106:9696"
# host = "mlzoomcamp-tm.spdns.de:9696"
# host = "127.0.0.1:9696" # local
host = "localhost:9696" # local
url = f"http://{host}/predict"
random_fungi = {
"cap-shape": "x",
"cap-color": "o",
"does-bruise-or-bleed": "f",
"gill-color": "w",
"stem-color": "w",
"has-ring": "t",
"habitat": "d",
"season": "w",
"cap-diameter": 40.0,
"stem-height": 3.0,
"stem-width": 5.0,
}
response = requests.post(url, json=random_fungi).json()
# response.value()
primary_data = pd.read_csv("./data/raw/primary_data_edited.csv", sep=";")
pred_overview = primary_data[primary_data["name"] == response["fungi"]]
# pred_overview
# overview = primary_data[primary_data["name"] == "Soft Slipper Toadstool"]
print(pred_overview.T)