Skip to content

baatout/ml-in-prod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

33afca9 · Sep 8, 2018

History

12 Commits
Sep 8, 2018
Sep 8, 2018
Sep 8, 2018
Sep 8, 2018
Jul 14, 2018

Repository files navigation

ML in prod

A python predictive system design.

Article: https://medium.com/contentsquare-engineering-blog/machine-learning-in-production-c53b43283ab1

Building the pipeline

$ cd training
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ python training.py

Running the server

  • If you did the previous steps then:
$ cd ../; deactivate
$ cd server
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ python run_server.py

Making online predictions

Once the server is up and running you can send features via POST requests and then receive the corresponding prediction (0 or 1). You can find an example of the request body in server/post.json:

$ curl -H "Content-Type: application/json" -X POST --data @post.json http://localhost:5000/predict