7. Data Attributes
● Inspection Date
● Inspection Type
● Violation Code
● Critical Flag
● Grade (A,B,C)
● Scores
● ID
● Restaurant Name
● Cuisine Description
● New York Boro
● Zip Code
RESTAURANT DETAILS VIOLATION DETAILS
477,000 rows
8. Data Cleaning
1
2
3
4
Removed rows with
inspection dates in the
future.
REMOVED
BAD DATA
Reduced number
of rows
SHRANK
DATA SET
FIXED SPELLING &
INCONSISTENCIES
REPLACEMENT
& FLAG CREATION
Fixed spelling errors.
Replaced ‘Not Yet Graded’
with ‘N’.
Broke ‘Inspection Type’
into 2 columns.
Violation Categories
Inspection Categories
Seasonal Flags
Landmark Flags
13. 1,438,159 population
13,221 persons/sq. km
9.48%
2,321,580 population
8,237 persons/sq. km
24.07%
39%
Violations
Manhattan
3%
Violations
Staten Island
24%
Violations
Brooklyn
9%
Violations
Bronx
24%
Violations
Queens
Restaurant Density vs. Percent Violations
15. Insight:
There are not major
differences in average
restaurant scores
despite differing
borough wealth and
popularity.
Do inspection scores differ
across borough? ?
16. Recommendation:
Re-opening average
scores are lowest
scores. A separate
process could be in
place for re-openings to
ensure good scores.
Inspection Type:
How Do Scores Differ for Inspection Types ?
17. Restaurant Grade Distribution:Takeaways:
● Hamburgers,
Cafes and
American
food have the
highest % of
A grades.
● Indian food
has the
largest share
of C grades
Grade A
Grade B
Grade C
Source: What’s the safest food in New York City? - Data Diversions - tumblr.com [NYC Open Data]
25. Cluster Findings:
What are the prevalence of violations by season?
Takeaways:
Cluster 1: Spring
Cluster 2: Summer
Cluster 3: Winter.
highest Manhattan
incidence
Cluster 4: Spring
All Clusters:
American & Chinese
food violations,
Manhattan &
Brooklyn, Score
impactful on all
clusters, especially
1 & 4
Other Findings:
Staten Island is not
impactful on any
cluster
26. Cluster Findings:
What are the prevalence of violations by grade?
Takeaways:
Cluster 1: C Grade,
Food Temp,
Flies/Food Refuse
Violation, Mice
Cluster 2: A Grade
Cluster 3: A Grade,
highest Manhattan
incidence
Cluster 4: B Grade
All Clusters:
Manhattan
impactful on all
clusters
29. Focus Point: Chipotle
Answer:
Yes...in STATEN
ISLAND - No
violations were
detected in any
Chipotle outlets there
Top Borough for
violations at Chipotle
outlets:
MANHATTAN
32. Focus Point: Landmark Restaurants
Landmark
Restaurants:
- Famous
- Oldest
- Movie Scenes
- Favorites
33. Focus Point: Landmark Restaurants
Hypothesis
Confirmed:
Not Critical violations
are more common for
Landmark
restaurants than
others.
34. Focus Point: Landmark Restaurants
Hypothesis
Confirmed:
Landmark
restaurants have
higher percentage of
A’s.
35. Focus Point: Landmark Restaurants
Finding:
Second most
common violation for
landmark restaurants
due to not cleaning
surfaces after each
use
Recommendation:
Hire employee who
cleans while chefs
cook
36. Focus Point: Landmark Restaurants
Hypothesis Not
Supported:
Violations, or lack
thereof are not
indicators of
Landmark
restaurants.
38. Part One: Decision Tree Model
VIOLATION PREDICTION --- Interpreting the Inspection Result
What kind of restaurants are more likely to be judged critical violation?
Key: Create a CRITICAL_DUMMY according to CRITICAL_FLAG; Assign Role “Target” and Level “Binary”
Not Critical Critical
Critical_Dummy = 0
VS Critical_Dummy = 1
42. Findings (Two-Way):
Grade
1.0000
Inspection
_Type
0.4314
BORO
0.1675
Restaurants who get a
score under B are 68.17%
likely to be judged critical
violation, compared to
48% likely to be critical
violation with Grade A.
Restaurants with an initial
low grade are more likely
to be judged a critical
violation during re-
inspection, with a
possibility to nearly 70%.
“BORO” does not appear
to affect much on Critical
Violation. The probability for
critical judging is around
52% for re-inspection with
initial high grades in all
regions.
43. Part Two: Logistic Regression
Outcome: Critical_Dummy
Variable Selection: Stepwise
44.
45. Findings (Similar to Decision Tree):
Score GRADE BInspection
Type
GRADE C
0.0983 0.0948 0.06100.1596
47. ● Dine after Spring, since restaurants have been issued the most violations
by that time.
● Be wary of Indian and Chinese restaurants in New York City.
● Don’t pay Manhattan prices; it does not have cleaner restaurants.
● If you want to eat at Chipotle, go to Staten Island.
FOR THE HUNGRY CONSUMER
48. ● Hire a dedicated cleaner in high-volume landmark restaurants.
● Since Facility Amenities violations are the most common, construction
is a critical stage -- do extensive research before contracting.
● Focus on cleanliness for the Spring season.
● Be sure to do well for re-inspection, you’ll either pass with flying colors
or be severely penalized.
● Set a benchmark to be met before allowing re-opening.
FOR RESTAURANTS