This is the repository associated with the youtube tutorial at: TODO: It is very simplistic and is meant as a guideline for implementing a Machine Learning API and not necessarily a good Machine Learning algorithm. I put particular emphasis on making this tutorial as short as possible.
I recommend using docker below, but also works like this:
pip install -r requirements.txt
cd TO/PATH
uvicorn main:app --reload
cd to the folder: cd PATH/TO/MlApiTutorial
run docker: docker-compose up --build
recommended: go in browser to http://localhost/docs (Assuming your docker hosts there else check docker ps
it's on port 80)
you can test the API directly with GUI http://localhost/docs
or sent to http://localhost/will_survive
tests: python -m main
run server: uvicorn main:app --reload
find IP: docker ps
'main.py' holds the API-related code. We put all in one file to make project simpler. 'test.py' has one test case to validate classifier is roughly working. 'Dockerfile' configures the server and installs dependencies. I used the Uvicorn/FastApi 'docker-compose.yml' not really needed. Simplifies execution on your side. I put restart: always incase you test edge cases (I did not handle them). 'make_model.py' builds and selects a model. I did not validate them much since this is more of an API tutorial.
I implemented a test to integrate it. In practice running them in Travis, Circelci before pulling from GitHub would be better.
Check docker related deployment possibilities of your favorite cloud provider