All Projects → NawfalTachfine → PredictionAPI

NawfalTachfine / PredictionAPI

Licence: MIT license
Tutorial on deploying machine learning models to production

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to PredictionAPI

kenchi
A scikit-learn compatible library for anomaly detection
Stars: ✭ 36 (-35.71%)
Mutual labels:  scikit-learn
intro-to-ml
A basic introduction to machine learning (one day training).
Stars: ✭ 15 (-73.21%)
Mutual labels:  scikit-learn
Movie-Recommendation-Chatbot
Movie Recommendation Chatbot provides information about a movie like plot, genre, revenue, budget, imdb rating, imdb links, etc. The model was trained with Kaggle’s movies metadata dataset. To give a recommendation of similar movies, Cosine Similarity and TFID vectorizer were used. Slack API was used to provide a Front End for the chatbot. IBM W…
Stars: ✭ 33 (-41.07%)
Mutual labels:  scikit-learn
spicedb
Open Source, Google Zanzibar-inspired fine-grained permissions database
Stars: ✭ 3,358 (+5896.43%)
Mutual labels:  production
TF-Speech-Recognition-Challenge-Solution
Source code of the model used in Tensorflow Speech Recognition Challenge (https://www.kaggle.com/c/tensorflow-speech-recognition-challenge). The solution ranked in top 5% in private leaderboard.
Stars: ✭ 58 (+3.57%)
Mutual labels:  scikit-learn
dwoole
⚙️ Docker image for Swoole apps with Composer, auto-restart on development and a production-ready version.
Stars: ✭ 32 (-42.86%)
Mutual labels:  production
Datacamp Python Data Science Track
All the slides, accompanying code and exercises all stored in this repo. 🎈
Stars: ✭ 250 (+346.43%)
Mutual labels:  scikit-learn
CFE-Blank-Project
A blank Django Starter Project that includes Docker support.
Stars: ✭ 17 (-69.64%)
Mutual labels:  production
go-ml-benchmarks
⏱ Benchmarks of machine learning inference for Go
Stars: ✭ 27 (-51.79%)
Mutual labels:  scikit-learn
errors
errors with paired message and caller stack frame
Stars: ✭ 19 (-66.07%)
Mutual labels:  production
lending-club
Applying machine learning to predict loan charge-offs on LendingClub.com
Stars: ✭ 39 (-30.36%)
Mutual labels:  scikit-learn
pipeline
PipelineAI Kubeflow Distribution
Stars: ✭ 4,154 (+7317.86%)
Mutual labels:  scikit-learn
100DaysOfMLCode
I am taking up the #100DaysOfMLCode Challenge 😎
Stars: ✭ 12 (-78.57%)
Mutual labels:  scikit-learn
source
Source: a component library for the Guardian's Design System
Stars: ✭ 97 (+73.21%)
Mutual labels:  production
hub
Public reusable components for Polyaxon
Stars: ✭ 8 (-85.71%)
Mutual labels:  scikit-learn
Artificial Intelligence Deep Learning Machine Learning Tutorials
A comprehensive list of Deep Learning / Artificial Intelligence and Machine Learning tutorials - rapidly expanding into areas of AI/Deep Learning / Machine Vision / NLP and industry specific areas such as Climate / Energy, Automotives, Retail, Pharma, Medicine, Healthcare, Policy, Ethics and more.
Stars: ✭ 2,966 (+5196.43%)
Mutual labels:  scikit-learn
imbalanced-ensemble
Class-imbalanced / Long-tailed ensemble learning in Python. Modular, flexible, and extensible. | 模块化、灵活、易扩展的类别不平衡/长尾机器学习库
Stars: ✭ 199 (+255.36%)
Mutual labels:  scikit-learn
sktime-tutorial-pydata-amsterdam-2020
Introduction to Machine Learning with Time Series at PyData Festival Amsterdam 2020
Stars: ✭ 115 (+105.36%)
Mutual labels:  scikit-learn
Trajectory-Analysis-and-Classification-in-Python-Pandas-and-Scikit-Learn
Formed trajectories of sets of points.Experimented on finding similarities between trajectories based on DTW (Dynamic Time Warping) and LCSS (Longest Common SubSequence) algorithms.Modeled trajectories as strings based on a Grid representation.Benchmarked KNN, Random Forest, Logistic Regression classification algorithms to classify efficiently t…
Stars: ✭ 41 (-26.79%)
Mutual labels:  scikit-learn
pygrams
Extracts key terminology (n-grams) from any large collection of documents (>1000) and forecasts emergence
Stars: ✭ 52 (-7.14%)
Mutual labels:  scikit-learn

PredictionAPI

This is a tutorial on serving predictions from a machine learning model through a REST API.

A version of this tutorial was presented in the PyParis conference on 13/06/2017.

A complete written version is currently in the making.

Steps

  1. training and persisting the model on disk (cf. modeling.ipynb),
  2. reproducing the pre-processing pipeline in the API application (cf. application.py),
  3. encapsulating the application in a Docker container (cf. Dockerfile),
  4. deploying the application to a cloud server.

Technical Requirements

  • Python 3.5+ and virtualenv,
  • Docker,
  • The required Python librairies used can be installed from the included requirements.txt file:
virtualenv -p python3 pyenv
source pyenv/bin/activate
pip install -r requirements.txt

Running the application locally

Directly

cd PredictionAPI
export FLASK_APP=application.py
python3 -m flask run

On Docker

cd PredictionAPI
docker build -t prediction-api .
docker run -d --rm -p 5000:5000 prediction-api

Testing the application

Once it is running, the API can be queried using HTTP POST requests. This can be done from the CLI using curl or through a GUI REST client like Insomnia or Postman.

URL: http://0.0.0.0:5000/api/v1.0/aballone

Here is a sample query:

{    
  "inputs": [
    {
      "sex":"M",
      "length": 0.815000,
      "diameter": 0.055000,
      "height": 1.130000,
      "whole_weight": 2.825500,
      "shucked_weight": 1.488000,
      "viscera_weight": 0.760000,
      "shell_weight": 0.001500
    },
    {
      "sex":"F",
      "length": 0.815000,
      "diameter": 1.055000,
      "height": 1.130000,
      "whole_weight": 2.825500,
      "shucked_weight": 1.488000,
      "viscera_weight": 1.760000,
      "shell_weight": 0.001500
    }
  ]
}

The response should look like this:

{
  "outputs": [
    {
      "label": 1,
      "prob": 0.109
    },
    {
      "label": 1,
      "prob": 0.183
    }
  ]
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].