Showing posts with label Rest. Show all posts
Showing posts with label Rest. Show all posts

Tuesday, 27 March 2018

ML-DL model as a Service - MLaaS



It is not always the case when we have to give or share the ML/DL model or algorithm with Client, sometime we want to allow users to use our model but without sharing the code or without setting up the infrastructure at Client end.

There is a way to achieve this, Convert your model as a Service, Yes, You can do that. You can expose your model as a Rest Service and user can use the method supported by your Service program. Today, we are going to learn the same.
Let's see how -



Tools Required - 
Flask - A python web server
and of course Python :-)


ML/DL Model Creation: 
For this part, I am picking very basic ML problem - IRIS dataset Classification.
Below code will create a Logistic Regression Classification Model and Save the model as a file.
==

Flask Web Server - REST Service
In below code, we are creating a REST service hosted on local system and having endpoint as "\iris" and Posting the array input to predict the IRIS species
==

How to run Flask Server:
    


Call ML Service:  From Command Line:


Call ML Service:  From Postman Client:









Like the below page to get update  
Facebook Page      Facebook Group      Twitter Feed      Google+ Feed      Telegram Group