new york city restaurant inspection analysis

Post on 15-Apr-2017

69 Views

Category:

Data & Analytics

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Should You Eat There?An Analysis of NYC Restaurant Inspection Data

Busi

ness

In

telli

genc

e &

Dat

a An

alyt

ics

Samantha Grant Jingshu Sun

Akash Dhruv

Candice Brown

Leeyat Slyper

Meet Our TeamGroup 2

AgendaThe Data

Data Exploration

Unsupervised Learning

Supervised Learning

Recommendations

1

2

3

4

5

Business Objectives

IDENTIFYING

VIOLATIONTRENDS

1

PREDICTING VIOLATIONS

2

REDUCING VIOLATION

S

3

Help NYC restaurant, and restaurant-goers by...

So there won’t be any more of this...

Part 01

The Data

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

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 CategoriesInspection CategoriesSeasonal FlagsLandmark Flags

● Allergies/Safety

● Animals

● Certification

● Documentation

Replacement 110 Violation Codes → 13 Violation Categories

● Facility Amenities

● Tobacco

● Facility Cleanliness

● Hazardous Chemicals

● Food Temperature

● Food Contamination

● Tobacco

● Worker Cleanliness

● Other

Part 02

Data Exploration

TOP 3 Violation

Categories

#1Facility

Amenities

#2Animals

#3Facility

Cleanliness

? Violation Trends:What are the most common violation types?

?Violation Density:Which borough has the most violations?

Staten Island

Queens

Brooklyn

Bronx

Manhattan

1,438,159 population13,221 persons/sq. km9.48%

2,321,580 population8,237 persons/sq. km24.07%

39%ViolationsManhattan

3%Violations

Staten Island

24%Violatio

nsBrooklyn

9%Violatio

nsBronx

24%Violatio

nsQueens

Restaurant Density vs. Percent Violations

These articles confirm our findings...

Insight:

There are not major differences in average restaurant scores despite differing borough wealth and popularity.

Do inspection scores differ across borough??

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?

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]

Part 3

Unsupervised Learning

Association RulesAnimals

Facility Amenities

Worker Cleanliness

Facility Cleanliness

Food Temperature

Food Contamination

1.06 Lift

1.01 Lift

Violations per SeasonWinter

~2kSpring

>2KSummer

<1.5kFall

~1.5k

Seasonal Trends:Which season has the most

violations? Spring has the most violations & American, Chinese and Italian Food had the most violations.

?

Winter Spring Summer Fall

Clustering Results:

Clustering Results:Segment Size

Clustering Results:

Takeaway: Seasonal Dummy Variable was the most influential

across the board Variable Worth

Cluster Findings:What are the prevalence of violations by

season?

Takeaways:

Cluster 1: SpringCluster 2: Summer Cluster 3: Winter. highest Manhattan incidenceCluster 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

Cluster Findings:What are the prevalence of violations by

grade?

Takeaways:

Cluster 1: C Grade, Food Temp, Flies/Food Refuse Violation, MiceCluster 2: A Grade Cluster 3: A Grade, highest Manhattan incidenceCluster 4: B Grade

All Clusters: Manhattan impactful on all clusters

Part 4

Supervised Learning

Should you eat at Chipotle?

?

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

Focus Point: ChipotleTakeaways:

Most common violations category:

1. Animals: 04N

2. Food Temperature: 02B, 02G

3. Worker Cleanliness: 06A, 06B

Do landmark NY restaurants perform

better??

Focus Point: Landmark Restaurants

Landmark Restaurants:

- Famous- Oldest- Movie

Scenes- Favorites

Focus Point: Landmark Restaurants

Hypothesis Confirmed:

Not Critical violations are more common for Landmark restaurants than others.

Focus Point: Landmark Restaurants

Hypothesis Confirmed:

Landmark restaurants have higher percentage of A’s.

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

Focus Point: Landmark Restaurants

Hypothesis Not Supported:

Violations, or lack thereof are not indicators of Landmark restaurants.

What factors lead to a judgement of

critical violation??

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 CriticalCritical_Dummy = 0

VSCritical_Dummy = 1

Unsupervised Learning

SCORE

CRITICAL_FLAGCheatin

gSplittin

g

?

Variable Selection

Unsupervised Learning

Two-Way

&Three -

Way

?

Running Model:Data Partition--70% Training Data & 30% Validation Data

Findings (Two-Way):

Grade1.0000

Inspection_Type0.4314

BORO0.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.

Part Two: Logistic RegressionOutcome: Critical_Dummy

Variable Selection: Stepwise

Findings (Similar to Decision Tree):

Score GRADE BInspection Type

GRADE C

0.0983 0.0948 0.06100.1596

Part 4

Recommendations

● 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

● 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

Questions?Thanks for listening!

top related