@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Iris Prediction API
|
2 |
+
|
3 |
+
This repo contains an Iris prediction server.
|
4 |
+
To get start the application, run:
|
5 |
+
```
|
6 |
+
uvicorn app.main:app --host 0.0.0.0 --port 8000
|
7 |
+
```
|
8 |
+
|
9 |
+
## Fetching Predictions
|
10 |
+
|
11 |
+
If the API server is running at `http://localhost:8000`, then the following should work in a local Python session:
|
12 |
+
```text
|
13 |
+
>>> import requests
|
14 |
+
>>> response = requests.post(
|
15 |
+
... "http://localhost:8000/prediction",
|
16 |
+
... json={
|
17 |
+
... "sepal_width": 1,
|
18 |
+
... "sepal_length": 1,
|
19 |
+
... "petal_length": 1,
|
20 |
+
... "petal_width": 1,
|
21 |
+
... },
|
22 |
+
... )
|
23 |
+
>>> response.status_code
|
24 |
+
200
|
25 |
+
>>> response.json()
|
26 |
+
{'flower_type': 0}
|
27 |
+
```
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
[build-system]
|
2 |
+
requires = ["setuptools"]
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[metadata]
|
2 |
+
name = app
|
3 |
+
version = 0.1.0
|
4 |
+
|
5 |
+
[options]
|
6 |
+
package_dir =
|
7 |
+
app = app
|
8 |
+
install_requires =
|
9 |
+
anyio==3.6.2
|
10 |
+
attrs==22.2.0
|
11 |
+
black==23.3.0
|
12 |
+
certifi==2022.12.7
|
13 |
+
click==8.1.3
|
14 |
+
colorama==0.4.6
|
15 |
+
exceptiongroup==1.1.1
|
16 |
+
fastapi==0.88.0
|
17 |
+
h11==0.14.0
|
18 |
+
httpcore==0.16.3
|
19 |
+
httptools==0.5.0
|
20 |
+
httpx==0.23.3
|
21 |
+
idna==3.4
|
22 |
+
iniconfig==2.0.0
|
23 |
+
joblib==1.2.0
|
24 |
+
mypy-extensions==1.0.0
|
25 |
+
numpy==1.24.2
|
26 |
+
packaging==23.0
|
27 |
+
pandas==1.5.3
|
28 |
+
pathspec==0.11.1
|
29 |
+
platformdirs==3.2.0
|
30 |
+
pluggy==1.0.0
|
31 |
+
pydantic==1.10.7
|
32 |
+
pytest==7.2.2
|
33 |
+
python-dateutil==2.8.2
|
34 |
+
python-dotenv==1.0.0
|
35 |
+
pytz==2023.3
|
36 |
+
pyyaml==6.0
|
37 |
+
rfc3986[idna2008]==1.5.0
|
38 |
+
scikit-learn==1.2.2
|
39 |
+
scipy==1.9.3
|
40 |
+
six==1.16.0
|
41 |
+
sniffio==1.3.0
|
42 |
+
starlette==0.22.0
|
43 |
+
threadpoolctl==3.1.0
|
44 |
+
tomli==2.0.1
|
45 |
+
typing-extensions==4.5.0
|
46 |
+
uvicorn[standard]==0.20.0
|
47 |
+
watchfiles==0.19.0
|
48 |
+
websockets==11.0
|
49 |
+
|
50 |
+
[options.package_data]
|
51 |
+
app = models/*
|