Skip to content Skip to sidebar Skip to footer

Python Programming: Build a Recommendation Engine in Django

Python Programming: Build a Recommendation Engine in Django

Collaborative Filtering with Python, Celery, Django, Worker Processes, Batch Predictions, SurpriseML, Keras, and more! New

On Udemy Coupon

Build a recommendation engine using Django & a Machine Learning technique called Collaborative Filtering.

Users will rate movies and the system will automatically recommend new ones. These recommendations will be done in batches (ie not in real time) to unlock a more scalable system for training and helping thousands and thousands of users.

For this course, we'll use a real dataset called MovieLens; this dataset is downloaded in CSV and is used on all kinds of machine learning tutorials. What's special about this course is you'll load this dataset into a SQL database through a Django model. This alone might be worth watching the course as SQL databases are far more powerful than CSV files.

To do the batch inference we implement the incredibly powerful background worker process called Celery. If you haven't used Celery before, this will be an eye opening experience and when you couple it with Django you have a truly powerful worker process that can run tasks in the background, run tasks on a schedule, or a combination of both. Tasks in Celery are simply Python functions with a special decorator.

For rating movies, we'll be using HTMX. HTMX is a way to dynamically update content *without* reloading the page at all. I am sure you know the experience whenever you click "like" or "subscribe" , that's what HTMX gives us without the overhead of using 1 line of JavaScript. This course shows us a practical implementation of using HTMX not just for rating movies, but also sorting them, loading them, and doing much more.

The recommendation engine in Django is really a collection of 3 parts:

Web Process: Setup up Django to collect user's interest and provide recommendations once available.

Machine Learning Pipeline: Extract data from Django, transform it, and train a Collaborative Filtering model.

Worker Process: This is the glue. We'll use Celery to schedule/run the trained model predictions and update data for Django-related user recommendations.

Recommended Experience

  • Python 3.6+ (such as 30 Days of Python)
  • Django 3.2+ (such as Your First Django Web Project or Try Django 3.2)
  • Celery with Django (such as Time & Tasks 2 or this blog post)

What you'll learn

  • Learn how to integrate Django & Celery
  • Learn how to use HTMX with Django for Dynamic Loading (no JavaScript Needed)
  • Training a Machine Learning Model with SurpriseML and an example in Keras
  • Build a rating system in Django with dynamic rating buttons. These ratings can be used on any Django Model
  • Learn how to run periodic background task and/or schedule functions to run exactly when needed
  • How to perform batch inference effectively using Django for *any* large workloads and/or ML packages
  • How to load large datasets into a SQL database through Django Models
  • Where to find great datasets online
  • How to implement an "infinite" review page that will always give a new item after rating.
  • So much more!

Online Course CoupoNED based Analytics Education Company and aims at Bringing Together the analytics companies and interested Learners.