Subscribe

4 steps to build real-world ML products - Part 1

Aug 14, 2023

Building complete ML products, as opposed to just training ML models inside notebooks, is what most companies need and look for. Unfortunately, there are not so many resources to learn that.

This is the blind spot I wanna address today, with a real-world example.

 

Steps to Solve a real-world business Problem with Machine Learning

These are the 4 steps we will cover in this and the next 3 newsletters:

  1. Problem framing (today) 🖼️

  2. Data preparation (next week)

  3. Model training

  4. MLOps

Let’s get to work!

 

Example

Imagine you work at a ride-sharing app company in NYC as an ML engineer. And you want to help the operations team allocate the fleet of drivers optimally each hour of the day. The end goal is to maximize revenue.

Before you start typing any code, you need to frame this business problem as an ML problem.

 

Step 1. Problem framing 🖼️

Problem framing is about connecting your business end goal (e.g. increase revenue) with the ML problem you need to solve to get there.

In this case, the fleet operations team wants to increase revenue by increasing the number of pick-ups.

To achieve this you need to find a way to balance the supply (of drivers) with the demand (of passengers). Whenever there is a mismatch between these 2, the company is losing money:

  • Excess drivers happen when the supply of drivers in a certain area of NYC is way higher than the number of people requesting a ride in that area. Drivers could have gone somewhere else, where demand was higher, so the

  • Lack of drivers happens when the supply of drivers is too low to pick up all potential passengers in that area.

  • Supply and demand balance is what you want to achieve. 💰

Supply vs demand (Image by the author)

A reasonable way to solve this is to predict how many passengers will be requesting rides on each

  • area of NYC

  • in the following 60 minutes

and use these predictions to help position the drivers optimally in the city.

 

From predictions to actions 🔮 →

To go from model predictions to actual actions, the fleet operations team could, for example, send push notifications to drivers, offering a price incentive to go to areas with high-predicted demand (e.g. +$2 for each pick-up around Central Park in the next 60 minutes).

From ML predictions to actual actions

 

 

Next steps

We have defined the ML problem to solve. Next week, we will move on to step 2, aka data preparation.

➡️ Go to part 2