Deploying ML Model using Flask

 

Why Flask?


Flask is a Python-based microframework used for developing small scale websites. Flask is very easy to make Restful API’s using python.

  • Easy to use.
  • Built in development server and debugger.
  • Integrated unit testing support.
  • RESTful request dispatching.
  • Extensively documented.

 

Project Structure

 
This project has four parts :

  1. model.py — This contains code for the machine learning model to predict sales in the third month based on the sales in the first two months.
  2. app.py — This contains Flask APIs that receives sales details through GUI or API calls, computes the predicted value based on our model and returns it.
  3. request.py — This uses requests module to call APIs defined in app.py and displays the returned value.
  4. HTML/CSS — This contains the HTML template and CSS styling to allow user to enter sales detail and displays the predicted sales in the third month.


Serializing/De-Serializing

In simple words serializing is a way to write a python object on the disk that can be transferred anywhere and later de-serialized (read) back by a python script.

Image for post

Comments

Popular posts from this blog

Supervised Learning(Part-5)

Supervised Learning(Part-2)

Convolutional Neural Networks(Part-2)