Coder Social home page Coder Social logo

deploying-ml-models-as-web-service's Introduction

flasking machine learning models

Using Flask to creat a Web API for a trained machine learning model to persist the model learning state and use it for predictions on the go. Since the focus of this project is to demonstrate the model integration to a website, a basic support vector machines model for predicting iris type is used.

Major steps involved from model side are:

  1. Create a model
  2. Dump the trained model using Joblib or pickle, Joblib is efficient when the datasize is more and numpy arrays are involved.
  3. Create a Flask API to receive the request from Website
  4. Read the Json request in to a data frame. Please note that shape of the input needs to be same as the shape of the input features used while training model.
  5. Load the persisted model
  6. Predict using the loaded model and return the prediction in Json format.

from the web dev side:

  1. open the nginx config files
  2. In the sites-available folder add the following line to redirct the reqeusts
    location /python-api-modelname {  proxy_pass http://localhost:8889;       }
    
    
  3. restart the nginx server and test the connection on postman

deploying-ml-models-as-web-service's People

Contributors

naveenkambham avatar

Stargazers

 avatar

Watchers

 avatar  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.