Hero Backgroud Elements 2
Reading Time: 4 Min

Visualizing New York City Restaurant Inspections using SAP Analytics Cloud

November 19, 2020

Jason Yeung Jason Yeung
Vice President, NA Center of Excellence, Platform & Technologies at SAP

Each year, the New York City Health Department inspects over 30,000 restaurants in an effort to improve the quality and safety of restaurants. These unannounced inspections result in over 100,000 violations ranging from employees not washing their hands to rodent infestation. Each of these violations are assigned a certain number of points, which is then calculated to form an inspection score – the lower the score, the better the grade.

Thanks to NYC Open Data, the city publishes this data for people to gain better transparency into their services. While this raw data is useful, they offer very little analytics and insights. Until now…

The most common inspections are initial inspections and routine re-inspections.

Of all of the inspections, 54.7% of these citations found were deemed “critical” and 91.5% of all restaurants inspected have some sort of citations.

The types of violations

The NYC inspectors check for compliance in food handling, food temperature, personal hygiene and vermin control. The most common violations are:

  • Food temperature
  • How they store and handle food
  • Food surfaces that are used to prepare the food

If we drill down into the critical violations, the two big ones that stand out are:

  • Facility not vermin proof
  • Evidence of mice

Who are the worst offenders?

Not surprisingly, fast food restaurants appear to be the worst offenders with the most “critical” violations. To be fair, these establishments have many restaurants across the city and naturally they’re going to accumulate the most citations. But, if you look at the average number, the data can be skewed the other way – for those smaller restaurants that have only had one inspection.

If we drill down further, we see that their issues range from temperature, hand washing, food storage, and rodents.

If we filter on Vermin and Rodents, the fast food chains tend to dominate this list.

Is the NYC Health Department helping these restaurants get better?

The goal of these health inspections is for restaurants to improve their health quality and safety.

Since they started collecting statistics (2014), over the past 5 years, 2,041 restaurants have been closed and 400 have been re-closed. On the positive side, 2,037 have been “re-opened” meaning that they improved their overall quality.

If we trend this over time, we can see that while the average scores haven’t changed much. The number of restaurants that have received an “A” grade have increased. This can be attributed to new restaurants opening (new restaurants have worse scores than existing) and inspections that have led to the closure of restaurants.

What predictive factors influence a restaurant’s score?

This is where advanced analytics can provide us with some additional insights. The algorithm below shows all the key influencers that impacts the score of a restaurant. “Grade” is fairly straight forward (the higher the grade, the lower the score), but some of the less obvious ones are the violations, inspection type, and building.

The violations that most commonly lead to higher scores seem like some of the easiest ones to fix. 05F is related to the temperature of prepared and unprepared food, 05C is the construction of the food surface, 05E is the toilet facilities, and 05H is improper hand washing. Despite the signs that you see at every restaurant, not all of your employees follow it.

Also, the type of inspection seems to reveal a lot. Initial inspections have much worse scores and grades than re-inspections.

What does this all mean?

After analyzing the data, a few takeaways stood out:

  1. Nearly every restaurant has some sort of issues and very few go without a single violation. The key is to avoid those with a recent history of many critical violations. Some may have suspected fast food restaurants as not being the cleanest restaurants in NYC, and the data supports this.
  2. The NYC Department of Health is helping, which is ultimately a good thing for customers. Despite restaurant managers dreading these inspections, the number of Grade A restaurants increase each year, and the number of restaurants being closed are decreasing. The initial inspections seem to be the worst, but they get better with each subsequent visit.
  3. People need analytics not data. While NYC Open Data does an excellent job providing timely and updated raw data, they provide very little analytics and insight into this data. Analytics lets us see the whole story within the data so that we can make better informed decisions.