Beta
How can a meal delivery service improve operations?
📖 Background
Your client is a food company in India that provides meal delivery services to thousands of customers per week. They operate in 51 cities inside eight different regions of the country. To better serve their customers, they deliver meals from 77 fulfillment centers.
The company wants you to help them understand their customer base, meal preferences, and fluctuations in demand. They want to investigate ways to improve operations and reduce food waste.
💾 The data
Your client has provided you with almost three years of order information for each of their 77 fulfillment centers:
- "week" - week (1 - 145)
- "center_id" - id of the fulfillment center
- "city_code" - city identifier
- "region_code" - region identifier
- "center_type" - there are three types of centers: A, B, and C
- "op_area" - the size of the area serviced by the fulfillment center
- "meal_id" - each meal has a unique id
- "category" - food category (beverages, pasta, rice, etc.)
- "cuisine" - the type of cuisine for each meal
- "checkout_price" - the price the customer pays (including discounts, promotions, etc.)
- "base_price" - list price for the meal
- "emailer" - 1 if there was an email promotion for the meal, 0 otherwise
- "featured" - 1 if the website featured the meal, 0 otherwise
- "orders" - number of orders for that week for that meal id
suppressPackageStartupMessages(library(tidyverse))
deliveries <- readr::read_csv('data/meal_deliveries.csv', show_col_types = FALSE)
deliveries
💪 Competition challenge
Create a report that covers the following:
- What are the most popular food categories in each region?
- For each of the two cities with more than three fulfillment centers, would you recommend:
- Keeping the number of centers the same,
- Combine fulfillment centers, or
- Opening new centers
- Investigate the effectiveness of email campaigns and promoting meals on the website.
- Explore ways of forecasting food order numbers to assist purchasing managers in their planning.
🧑⚖️ Judging criteria
CATEGORY | WEIGHTING | DETAILS |
---|---|---|
Recommendations | 35% |
|
Storytelling | 35% |
|
Visualizations | 30% |
|
✅ Checklist before publishing into the competition
- Rename your workspace to make it descriptive of your work. N.B. you should leave the notebook name as notebook.ipynb.
- Remove redundant cells like the judging criteria, so the workbook is focused on your story.
- Make sure the workbook reads well and explains how you found your insights.
- Try to include an executive summary of your recommendations at the beginning.
- Check that all the cells run without error
⌛️ Time is ticking. Good luck!
# install.packages("tidyquant")
library(tidyverse)
library(tidymodels)
library(tidyquant)
EDA
#lets check if there are any missing values in each feature
deliveries |>
sapply(function(x) sum(is.na(x)))
1. What are the most popular food categories in each region?
food_category_by_region_tbl <- deliveries |>
select(region_code, category)
food_category_by_region_tbl |>
count(region_code, category) |>
arrange(desc(n))
food_category_by_region_tbl |>
mutate(n=n(),
category= reorder(category,n)) |>
ggplot(aes(x=region_code, y= category))+
geom_col(aes(fill = category))+
scale_x_continuous(labels = scales::label_number())+
#scale_x_continuous(labels = scales::dollar_format(scale = 1e-6, suffix = "M"))+
facet_wrap(~ region_code,scales = "free_x")+
guides(fill = "none") +
labs(
title = "Popular Food Categories by Region",
subtitle = "Regions 77, 56 and 34 are the main regions with food distributions by category",
caption = "Across all the regions, Beverages, Sandwich, Rice bowl, Pizzas and Starters respectively\n are the main categories of foods ",
y = "Food Category",
x = " " )+
scale_color_tq()+
theme_tq()