Get to Know the Problem
Explore supervised learning by solving a real-life problem and mapping the data onto 2D-graph.
The problem statement
Our friend owns a cozy little pizzeria in a busy metropolitan city. Every day at noon, they check the number of reserved seats and decide how much pizza dough to prepare for dinner. Too much dough, and it goes wasted, but too little, and they run out of pizzas. In either case, the restaurant loses money.
It’s not always easy to gauge the number of pizzas from the reservations. Many customers don’t reserve a table, or they eat something other than pizza. The owner knows that there is some kind of link between those numbers, in that more reservations generally mean more pizzas, but other than that, it’s not clear what the exact relation is.
The restaurant owner wants a program that looks at historical data, grasps the relation between reserved seats and pizzas and uses it to forecast tonight’s pizza sales from today’s reservations. Can we code such a program for them?
Supervised pizza
Remember what we learned back in Supervised Learning’s lesson? We can solve the pizza forecasting problem by training a supervised learning algorithm with a bunch of labeled examples. To get the examples, we ask the restaurant owner to jot down a few days’ worth of reservations and pizzas and collect those data in a file. Here’s what the first four lines of that file look like:
Reservations | Pizzas |
---|---|
13 | 33 |
2 | 16 |