Where to Find a Clean Restaurant in San Francisco

Posted on Feb 9, 2018


The Department of Public Health in San Francisco conducts unannounced inspections of restaurants at least once a year. It checks food handling, food temperature, personal hygiene, and vermin control and gives restaurants inspection scores. Unlike New York City, where the higher the letter, the worse the score, in San Francisco, the higher inspection score means indicates  more sanitary conditions. My purpose of developing this shiny app is to help the users find clean restaurants in San Francisco.

The inspection data used was obtained from Kaggle.com. The dataset contains the name, address, zip code, phone number and inspection score of each inspected restaurant in San Francisco.


1. Find clean restaurants by inspection score and emoji

On the first map, I categorized the restaurants by their inspection score and added them to the map. To show the restaurant score at a glance, I opted for emojis. My first idea was to plot restaurants using different colors to represent different categories of inspection score. However, I changed my mind after noticing that users may have their own preconceptions about what colors means. I saw a map online  that  used blue and red to represent clean and unclean. When I first looked at that map, I thought blue markers represented the clean restaurants and red markers represented unclean restaurants. When I realized that the author intended it the other way around, I thought that in order to avoid possible confusion, I would use graphic icons to represent restaurant rankings rather than colors.

The restaurant with an inspection score between 100 and 90 is thumbs-up, meaning that that is a very clean restaurant. When you zoom in on the map, you will see the name, address, score and phone number, in case you plan to make a reservation. I used a smiley face to represent restaurants with score between 89 and 80, which means that this place is clean enough to eat in. For restaurants with score 79 to 70, I used fearful face, meaning that you should probably not go there. For restaurants with score below 70, I used vomiting face, which is pretty intuitive and self-explanatory representation of why you should never go to those restaurants.

2. Find clean restaurants by zip code

On the second map, I grouped the restaurants by their zip code. Knowing what restaurants are available to you is one consideration when moving to a new neighborhood. When you use my app, simply select the zip code; it will show you how many restaurants have thumbs-up, smiley face, fearful face, and vomiting face. In fact, you can get the exact number of restaurants in each category from the info boxes.

3. Top five most and least sanitary foodie streets in San Francisco

On the third map, I plotted the top five most sanitary foodie streets and the five least sanitary foodie streets in San Francisco. To do this, I grouped the restaurants by their street name and took the median of restaurants’ inspection scores for each street. Using this map, it is very easy to find the most sanitary foodie streets and the least sanitary foodie streets. If you were to hang out with your friends in San Francisco on a Friday night, you wouldn’t want to go to a street that is full of unclean restaurants, right?

This is my app, if you would like to find a nice, clean restaurant in San Francisco, please use this app.

See my Shiny App here.

About Author

Xiaoyu Yang

Xiaoyu received his Ph.D. in Pharmaceutical Sciences from North Dakota State University. For his research, he designed and conducted a variety of experiments to improve current treatments for pancreatic cancer. He developed his interest in math and statistics...
View all posts by Xiaoyu Yang >

Related Articles

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp