Skip to content

Commit d388c7e

Browse files
author
nickc1
committed
initial commit
0 parents  commit d388c7e

File tree

6 files changed

+390
-0
lines changed

6 files changed

+390
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
.ipynb_checkpoints

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7
2+
3+
COPY ./app /app

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
How to train a simple sklearn model, pickle it, and build an API with fastapi.
2+
3+
Deployment to AWS will be covered in the future.
4+
5+
To follow this post, you should be familiar with:
6+
7+
1. Scikit-learn
8+
2. Docker
9+
3. Basics of an API
10+
11+
# Training the model
12+

app/main.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from fastapi import FastAPI
2+
3+
app = FastAPI()
4+
5+
6+
@app.get("/")
7+
def read_root():
8+
return {"Hello": "World"}
9+
10+
11+
@app.get("/items/{item_id}")
12+
def read_item(item_id: int, q: str = None):
13+
return {"item_id": item_id, "q": q}

model/model_1.joblib

878 Bytes
Binary file not shown.

model/model_building.ipynb

Lines changed: 356 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)