Awesome
PyML
Python Moonlight (Machine Learning) Practice
<br/><a name="contents"></a>
Contents
<br/><a name="pre-req"></a>
Prerequisites
- Python 3
- Python 3
pip
version 19.0.1 and up - Python 3 built-in virtual env
venv
- System tools: find, rm, tee, xargs, zip (for building, e.g. AWS Lambda package)
- Command line JSON processor: jq
- Docker (optional)
<br/><a name="dev-setup"></a>
Dev Setup
Running a dev-setup
script to install the project and libraries.
make clean dev-setup # this will create a python virtualenv
<br/><a name="testing"></a>
Testing
After running make dev-setup
, the project and libraries are installed (in python virtual environment). Now it is able to run tests.
make test # also available to run `make unittest` or `make nosetest`
or to start a clean test (highly recommended before committing changes) -
make clean test-all
and open test coverage report
make show # must be on docker host
<br/><a name="run"></a>
Run
API Example
-
run Gunicorn/Flask API in docker container
make run-api
-
run Gunicorn/Flask example in virtual environment (venv)
# start/enable venv (e.g. `source .venv/bin/activate`) make run-gunicorn
-
run Gunicorn/FastApi in venv
# start/enable venv (e.g. `source .venv/bin/activate`) make run-fastapi