Member-only story

Create a Machine Learning API With Django Rest Framework

Learn how to create a machine learning API with Django

Görkem Arslan
Better Programming
7 min readJul 5, 2021

--

computer with code on the screen
Photo by James Harrison on Unsplash

This tutorial will be in two parts.

  • In Part 1, we will train a simple machine learning model and create an API with the Django Rest framework.
  • In Part 2, we will deploy our project with a popular cloud service.
    (I will show you how to deploy your project via both AWS and GCP, and you can choose whatever you want.)

Now you’re reading Part 1, which consists of three subparts:

  • Build a model to predict a person’s weight given height and gender.
  • Create an API with Django to handle coming requests.
  • Test the API with Insomnia.

Before diving into the article, I have to say that this article is neither a Django tutorial nor shows how to solve a machine learning problem. In fact, the aim of the article is to combine a machine learning model with the Django project and also to productize your model as a machine learning API.

Build a Model

In this section, we are going to train a machine learning model that will be later used to make predictions for an API.

Dataset

--

--

Görkem Arslan
Görkem Arslan

Written by Görkem Arslan

Machine Learning | Python | Django

Responses (2)

Write a response