GithubHelp home page GithubHelp logo

deploy-ml-model-with-docker-and-flask's Introduction

Deploying ML Model using Flask

This is a simple project to elaborate how to deploy a Machine Learning model using Flask API

Prerequisites

You need to have Docker installed

Project Structure

This project has four major parts :

  1. src/modles/code - This Directory contains machine learning models training functions.
  2. src/app.py - This project entry file contains Flask app that receives employee details through GUI or API calls, computes the precited value based on our model and returns it.
  3. src/templates - This folder contains the HTML template (index.html) to allow user to enter employee detail and displays the predicted employee salary.
  4. src/static - This folder contains the css folder with style.css file which has the styling required for out index.html file.

Running the project

  1. Ensure that you are in the project home directory Create the machine learning model by running below command from command prompt -
python src/models/model.py

This would create a serialized version of our model into a file model.joblib

  1. Run app.py using below command to start Flask API
python src/app.py

By default, flask will run on port 5000.

  1. Navigate to URL http://127.0.0.1:5000/ (or) http://localhost:5000

You should be able to view the homepage.

Enter valid numerical values in all 3 input boxes and hit Predict.

If everything goes well, you should be able to see the predcited salary vaule on the HTML page! check the output here: http://127.0.0.1:5000/predict

deploy-ml-model-with-docker-and-flask's People

Contributors

abdoutony avatar iqrasa avatar maajidkhan 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.