Skip to content

A simple example of python api for real time machine learning, using scikit-learn, Flask and Docker

Notifications You must be signed in to change notification settings

geanderson-ai/python-flask-sklearn-docker-template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-flask-docker-sklearn-template

A simple example of python api for real time machine learning. On init, a simple linear regression model is created and saved on machine. On request arrival for prediction, the simple model is loaded and returning prediction.
For more information read this post

requirements

docker installed

Run on docker

docker build . -t {some tag name}
detached : docker run -p 3000:5000 -d {some tag name}
interactive (recommended for debug): docker run -p 3000:5000 -it {some tag name}

Run on local computer

python -m venv env
env\Scripts\Activate
python -m pip install -r ./requirements.txt
python app.py

Use sample api

127.0.0.1:3000/isAlive
127.0.0.1:3000/prediction/api/v1.0/some_prediction?f1=4&f2=4&f3=4

About

A simple example of python api for real time machine learning, using scikit-learn, Flask and Docker

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%