Tell a data story: Restaurant violations

Food inspections

In the heart of Boston lies a treasure trove of data known as the “Food Establishment Inspections.” With a whopping 65,534 observations across 26 variables, it serves as a comprehensive record of individual inspections and outcomes for the city’s diverse food establishments. These inspections span from as far back as April 2006 to the present day.

  1. Introduction

The dataset begins with a quest to understand the intricacies of Boston’s food industry. Each row in the dataset represents an inspection, offering a glimpse into the world of food establishment. The columns, on the other hand, are a trove of information related to these inspections. They reveal the business names, legal owners, license numbers, violation types, descriptions, and comments for specific violations, among other details.

Code part:

FEI<-read.csv(“restaurant violation.csv”)

View(FEI)

2. The Trail of Violations

As explorers of this data, our curiosity led us to uncover a fascinating discovery. After filtering the data, we stumbled upon a revelation—there were 14 types of violations that occurred more than 1,000 times each. Our next step was to unveil the nature of these violations.

We embarked on a discovery to match violation numbers with their corresponding descriptions, bring text information into what were once mere strings of numbers. The most frequent offender turned out to be “Non-Food Contact Surfaces Clean,” occurring a staggering 3,833 times. It was followed closely by “Improper Maintenance of Walls/Ceilings” at 3,430 occurrences, “Non-Food Contact Surfaces” at 3,130 times, “Improper Maintenance of Floors” at 2,781 instances, and “Food Protection” at 2,762 appearances.

Code part:

vio <- select(FEI,violation)

table(vio)

library(dplyr)

freq <- count(vio,violation)

viodes <- select(FEI,violation,violdesc)

viodes <- viodes[!duplicated(viodes[,c(‘violation’,’violdesc’)]),]

View(viodes[viodes$violation==’23-4-602.13′,])

View(viodes[viodes$violation==’37-6-501.11-.12′,])

df <- select(FEI,violdesc)

freq1 <- count(df,violdesc)

3. Levels of Violations

We were keen to unravel the relationship between the level of violation and the types of violations committed. Sorting the descriptions by violation level, we uncovered another fascinating insight.

For the most frequent violation, “Non-Food Contact Surfaces Clean,” all 3,833 violations were rated as one-star violations—a sign of relatively minor infractions. Expanding our view beyond the top five violations, we noticed that a whopping 15,936 cases were also tagged as one-star violations. However, the sixth most frequent violation, “Food Contact Surfaces Clean,” took a different path. It featured 1,477 two-star violations and 779 three-star violations, indicating more serious breaches.

Code Part:

violv <- FEI[c(‘violdesc’,’viollevel’)]

violv <- filter(violv,violdesc==’Non-Food Contact Surfaces Clean’)

lvnum <- count(violv,viollevel)

4. Food Establishment Analysis

In parallel, we investigated different types of food establishments and the numbers of violations caused by them. We discovered that ‘Eating & Drinking’ establishments had a staggering 16,106 reported violations, making them a significant contributor to food safety concerns. ‘Eating & Drinking w/ Take Out’ establishments followed closely with 12,202 violations, indicating that they also contribute to the share of issues. On the other hand, ‘Mobile Food Walk On’ establishments, known for their mobility, seemed to maintain high standards with only 88 violations. ‘Retail Food’ establishments, which typically sell packaged food, had 4,962 violations, showing they were not exempt from scrutiny either.

To better understand these findings, we decided to create a visualization with R. We plotted a bar chart that vividly displayed the total violations for each type of food establishment. ‘Eating & Drinking’ establishments towered above the rest, emphasizing their prominent role in food safety discussions.

Code Part:

FEI1 <- FEI%>%

  select(descript,violstatus)

FEI1 <- na.omit(FEI1)

summary_FEI1 <- FEI1 %>%

  group_by(descript) %>%

  summarize(Total_Violations = sum(violstatus == ‘Fail’))

ggplot(summary_FEI1, aes(x = reorder(descript, Total_Violations), y = Total_Violations)) +

  geom_bar(stat = “identity”) +

  theme(axis.text.x = element_text(angle = 45, hjust = 1)) +

  xlab(“Types of establishment”) +

  ylab(“Numbers of Violation”) +

  ggtitle(“Numbers of Violation caused by Different Types of Establishment “)

Story 1: “The Tale of Beijing Kyoto”

Code: 

BJK<-FEI[“54232”,]

Our individual story commences with a restaurant named “Beijing Kyoto,” an Asian fusion haven nestled near Chinatown. However, this story takes a somber turn. On row 54,232 from raw data, we discover that Beijing Kyoto is now permanently closed, shrouded in negativity on Yelp, a stark testament to the challenges of the culinary world.

It unravels a series of violations faced by Beijing Kyoto. Among them, one violation stands out—the placement of utensils and items in hand sinks. This seemingly minor offense garnered a level 3 violation, the highest severity. It serves as a reminder that the responsibility of a restaurant extends beyond taste to encompass cleanliness and hygiene.

Story 2: “Au Bon Pain’s Cold Challenge”

Code: 

viocom <- FEI[c(‘businessname’,’viollevel’)]

viocom <- filter(viocom,viollevel==’***’)

freq3 <- count(viocom,businessname)

View(ABP <- filter(FEI,businessname==’Au Bon Pain’,viollevel==’***’))

ABP <- filter(FEI,businessname==’Au Bon Pain’,viollevel==’***’)

freq4 <- count(ABP,zip)

View(FEI[FEI$businessname==’Au Bon Pain’& FEI$viollevel==’***’&FEI$zip==’2115′,])

ABP1 <- FEI[“35924”,]

Next, our exploration leads us to “Au Bon Pain,” a chain with a branch in zip code 2115. Here, we encounter a restaurant with a reputation for recurrent three-star violations. In row 35,924, we unearth the reason. The license status is ‘inactive,’ and the violation description, “cold holding,” offers insight. The comment reveals that their Tuna fish failed to maintain proper temperature, risking meat spoilage.

This narrative serves as a cautionary warning, reminding us that established chains can falter in food safety, jeopardizing reputation and trust.

Story 3: “The Unexpected Case of Violation Levels”

Code:

110Grill<-FEI[“325”,]

Curiosity beckons us to explore the relationship between violation levels and their status. The dataset hints at an intriguing pattern. One-star violations have a lower pass rate at 43%, compared to 48% for both two-star and three-star violations.

110 Grill provides an interesting glimpse into this phenomenon , as an Eating & Drinking establishment which license status is active, cited for a “drying mops “violation. Though seemingly minor, the comment further described the circumstance is wet mops were stored in a wet closet which carried critical implications.

Not only did it result in unpleasant odors from the mops but also posed the risk of bacterial growth and pest attraction. While the severe consequences had not yet manifested, it was a critical signal that demanded attention. This one-star violation with “Fail “status has reflected the importance of even seemingly minor infractions in the realm of food safety.

Summary: A Tapestry of Food Safety

The stories woven from the “Food Establishment Inspections” dataset underscore the multifaceted world of food establishments in Boston. They emphasize the importance of vigilance in upholding food safety standards, no matter the size or reputation of an establishment.

In this tapestry of food safety, each data point represents a individual story that reminds us of the need for diligence, awareness, and continuous improvement in the quest to provide safe and enjoyable dining experiences for all in the vibrant city of Boston.


Leave a comment