Git Product home page Git Product logo

ml-prediction-service's Introduction

Operationalise a Machine Learning Microservice API

CircleCI


Project Summary

The project contains a pre-trained, sklearn model that has been trained to predict housing prices in Boston according to several features, such as average rooms in a home and data about highway access, teacher-to-pupil ratios, and so on. You can read more about the data, which was initially taken from Kaggle, on the data source site. It serves out predictions (inference) about housing prices through API calls. This project could be extended to any pre-trained machine learning model, such as those for image recognition and data labeling.

The project uses Docker for containerization and Kubernetes for container orchestration


Running the App

Setting Up the Environment

  • Standalone

    • Ensure python 3.7 is available in the host machine
    • Install venv
    • Create the virtual environment for the project
    • Activate the environment
    • Install the app's dependencies by running:
    make install
  • Docker

    • Set up and configure Docker
    • (Optional) Install hadolint to lint the Dockerfile
  • Kubernetes

    • Set up and configure Docker
    • Set up and configure Kubernetes (minikube and Kubectl used in this project)
    • Create a containerized Flask application

Commands

  • Standalone:
python app.py
  • Run in Docker:
./run_docker.sh
  • Run in Kubernetes:
./run_kubernetes.sh

Files

  • app.py - flask application that returns the predictions
  • requirements.txt - contains the app's dependencies
  • Makefile - contains commands to easily setup a virtual environment, install dependencies, and lint files
  • Dockerfile - contains instructions on how to build a docker image
  • run_docker.sh - builds the docker image, tags it, and runs the container
  • upload_docker.sh - tags the docker image and pushes it to a repository
  • run_kubernetes.sh - runs the application in kubernetes
  • make_prediciton.sh - sends a request to the app for prediction
  • docker_out.txt - contains sample output of a successful response after running make_prediciton.sh with a successfully running container application
  • kubernetes_out.txt - contains sample output of successful response after running make_prediciton.sh with a successfully running application in kubernetes
  • .circleci/config.yml - CircleCI config file to build the app

ml-prediction-service's People

Contributors

lundih avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.