Member-only story

How to Build A Machine Learning API Using Flask

Let’s make your ML model applicable in real life!

Irfan Alghani Khalid
Towards Data Science
6 min readJun 1, 2021

--

Photo by Luca Bravo on Unsplash

Introduction

Machine Learning (ML) is a great way to do tasks that cannot be explicitly coded, for example, image classification. But when the model is already built, it will be useless when we don’t deploy it into an application.

Deployment is an essential step in the machine learning workflow. It is a step where we want to apply our ML model into an application. Afterwards, we can use the model in real life.

But how can we create the model as an application? We can build an Application Programming Interface (API). With that, we can access the model from everywhere, whether it is on the mobile application or even on the web application. In Python, there’s a library that can help us to build an API. It’s called Flask.

This article will show you how to build a REST API for our machine learning model using Flask. Without further ado, let’s get started!

REST API

Before we get into the implementation, let me explain REST API. REST API stands for Representational State Transfer Application Programming Interface.

The mechanism of REST API looks like this. Let’s say you want to search cat photos on…

--

--

Towards Data Science
Towards Data Science

Published in Towards Data Science

Your home for data science and AI. The world’s leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.

No responses yet