Project VORB

Motivation

This week I happened to read this article "Yelp And Michelin Have The Same Taste In New York Restaurants". In the article, Nate Silver (the author) argues a strong correlation between the recent Michelin stars for NY and his own scores based on Yelp data for the same restaurants. The fact that Yelp data when analyzed correctly could generate a ranking on a par with that curated by hundreds of tasting professionals was intriguing. If so, then we could do the same analysis and create a list for Philly (where Michelin sadly doesn't operate), right? Greg and I decided to do just that.

 Working out of our 3rd floor living room. Photo cred: Abhishek.

Working out of our 3rd floor living room. Photo cred: Abhishek.

VORB

VORB is the score Nate Silver used in his analysis. It stands for Value Over Replacement Burrito. Its original inspiration is VORP (Value Over Replacement Player), a score used in baseball to estimate the added value of a player compared to a baseline replacement player. The 'B' in VORB stands for 'Burrito' because Nate Silver first developed this score to figure out the best Burrito in America (formula for VORB is in the footnotes). After staring at the the VORB formula for a while, we decided to considerably simplify it into our own VORB score as follows:

VORB = (average rating - 3.3) * ln(total number of reviews) * (number of reviews since 2012 / MIN(number of days open, number of days since 2012))

Conceptually, this VORB score can be understood as (average opinion) * (confidence) * (recent popularity).

Data Mining

Getting the necessary data from Yelp was the bulk of the work. For Nate Silver, I imagine it was easy. It is likely that Yelp just gave it to him because he is a popular data journalist. For us, we had to earn it bit by bit. 

The first task was to get a long list of restaurants we wanted to consider. This was done using the Yelp API, asking it for a list of restaurants within a bounding box location. The box that we gave was something like this:

 Most areas of University City and Center City was included.

Most areas of University City and Center City was included.

Yelp's API only gives a list of 20 restaurants at a time, but we kept asking (with an added offset) until we had 500. We thought this was an adequate sample size because our goal is to find something like the best 30 restaurants in Philly, not a 1000. Also, because Yelp returns the list of restaurants in their own ordering logic, taking some faith in Yelp, we were able to assume that the best restaurants will be in the 500 sample size. The code we used is here.

After we had the list, we saved the html pages that held the reviews for all of these restaurants from Yelp's website. The process is quite tedious but doable. Each yelp page displays 40 reviews, so we kept requesting the next tab until we had all reviews for a specific restaurant. The average number of reviews for our sample of 500 restaurants was around 200. That means we scraped about 100,000 reviews by making about 100,000/40 = 2500 requests. For a computer this is a reasonable task. The only issue was that Yelp kept blocking us after we made a few dozen requests. In the end, we just kept running the program until we had all 100,000 reviews.

It is worth noting why getting ALL the reviews was necessary. It was because Yelp only provides average ratings in 0.5 increments (I hadn't realized before either, but check your Yelp app). For our purposes we needed to distinguish between a rating of 4.3 and 4.5, thus we had to get all the reviews and compute it ourselves.

Once we had all the html pages that held all the data we need, it was only a matter of parsing and computing VORB scores

Results

The top 20 restaurants are shown below. A list of top 100 can be found here. 'Recent reviews' indicate the number of reviews since 2012. To remind you again,

VORB = (average rating - 3.3) * ln(total number of reviews) * (number of reviews since 2012 / MIN(number of days open, number of days since 2012))

=  (average opinion) * (confidence) * (recent popularity)

---------------------------------------------------------------
Name: Zahav
URL: http://www.yelp.com/biz/zahav-philadelphia
Avg rating: 4.46
Total reviews / Recent reviews: 1010 / 694
Open date: 2009-05-18
VORB: 1.16 * 6.92 * 0.68 = 5.46
---------------------------------------------------------------
Name: Barbuzzo
URL: http://www.yelp.com/biz/barbuzzo-philadelphia
Avg rating: 4.29
Total reviews / Recent reviews: 973 / 703
Open date: 2010-12-04
VORB: 0.99 * 6.88 * 0.69 = 4.70
---------------------------------------------------------------
Name: Amada
URL: http://www.yelp.com/biz/amada-philadelphia
Avg rating: 4.25
Total reviews / Recent reviews: 1255 / 659
Open date: 2006-04-08
VORB: 0.95 * 7.13 * 0.64 = 4.37
---------------------------------------------------------------
Name: Monk's Café
URL: http://www.yelp.com/biz/monks-caf%C3%A9-philadelphia-3
Avg rating: 3.99
Total reviews / Recent reviews: 1381 / 826
Open date: 2007-07-15
VORB: 0.69 * 7.23 * 0.81 = 4.05
---------------------------------------------------------------
Name: Vedge
URL: http://www.yelp.com/biz/vedge-philadelphia
Avg rating: 4.44
Total reviews / Recent reviews: 557 / 538
Open date: 2011-11-21
VORB: 1.14 * 6.32 * 0.53 = 3.80
---------------------------------------------------------------
Name: Luke's Lobster
URL: http://www.yelp.com/biz/lukes-lobster-philadelphia-2
Avg rating: 4.33
Total reviews / Recent reviews: 319 / 319
Open date: 2013-06-05
VORB: 1.03 * 5.77 * 0.64 = 3.78
---------------------------------------------------------------
Name: El Vez
URL: http://www.yelp.com/biz/el-vez-philadelphia
Avg rating: 3.82
Total reviews / Recent reviews: 1510 / 1004
Open date: 2005-08-22
VORB: 0.52 * 7.32 * 0.98 = 3.74
---------------------------------------------------------------
Name: Tommy DiNic's
URL: http://www.yelp.com/biz/tommy-dinics-philadelphia
Avg rating: 4.16
Total reviews / Recent reviews: 1003 / 635
Open date: 2007-02-20
VORB: 0.86 * 6.91 * 0.62 = 3.71
---------------------------------------------------------------
Name: Bleu Sushi BYOB
URL: http://www.yelp.com/biz/bleu-sushi-byob-philadelphia-3
Avg rating: 4.31
Total reviews / Recent reviews: 90 / 90
Open date: 2014-06-22
VORB: 1.01 * 4.50 * 0.75 = 3.41
---------------------------------------------------------------
Name: Hai Street Kitchen & Co
URL: http://www.yelp.com/biz/hai-street-kitchen-and-co-philadelphia
Avg rating: 4.02
Total reviews / Recent reviews: 129 / 129
Open date: 2014-06-10
VORB: 0.72 * 4.86 * 0.98 = 3.40
---------------------------------------------------------------
Name: HipCityVeg
URL: http://www.yelp.com/biz/hipcityveg-philadelphia
Avg rating: 4.21
Total reviews / Recent reviews: 516 / 516
Open date: 2012-05-15
VORB: 0.91 * 6.25 * 0.58 = 3.29
---------------------------------------------------------------
Name: Nan Zhou Hand Drawn Noodle House
URL: http://www.yelp.com/biz/nan-zhou-hand-drawn-noodle-house-philadelphia
Avg rating: 4.18
Total reviews / Recent reviews: 838 / 559
Open date: 2009-02-24
VORB: 0.88 * 6.73 * 0.55 = 3.25
---------------------------------------------------------------
Name: Morimoto
URL: http://www.yelp.com/biz/morimoto-philadelphia
Avg rating: 4.28
Total reviews / Recent reviews: 1058 / 466
Open date: 2005-05-25
VORB: 0.98 * 6.96 * 0.46 = 3.11
---------------------------------------------------------------
Name: Vernick Food & Drink
URL: http://www.yelp.com/biz/vernick-food-and-drink-philadelphia
Avg rating: 4.55
Total reviews / Recent reviews: 317 / 317
Open date: 2012-09-17
VORB: 1.25 * 5.76 * 0.42 = 3.00
---------------------------------------------------------------
Name: Talula's Garden
URL: http://www.yelp.com/biz/talulas-garden-philadelphia
Avg rating: 4.29
Total reviews / Recent reviews: 537 / 481
Open date: 2011-07-05
VORB: 0.99 * 6.29 * 0.47 = 2.93
---------------------------------------------------------------
Name: Charlie Was a Sinner
URL: http://www.yelp.com/biz/charlie-was-a-sinner-philadelphia
Avg rating: 4.18
Total reviews / Recent reviews: 110 / 110
Open date: 2014-05-16
VORB: 0.88 * 4.70 * 0.70 = 2.91
---------------------------------------------------------------
Name: Dizengoff
URL: http://www.yelp.com/biz/dizengoff-philadelphia
Avg rating: 4.27
Total reviews / Recent reviews: 52 / 52
Open date: 2014-08-09
VORB: 0.97 * 3.95 * 0.72 = 2.77
---------------------------------------------------------------
Name: Abe Fisher
URL: http://www.yelp.com/biz/abe-fisher-philadelphia
Avg rating: 4.47
Total reviews / Recent reviews: 32 / 32
Open date: 2014-09-01
VORB: 1.17 * 3.47 * 0.65 = 2.65
---------------------------------------------------------------
Name: Han Dynasty
URL: http://www.yelp.com/biz/han-dynasty-philadelphia
Avg rating: 4.04
Total reviews / Recent reviews: 804 / 542
Open date: 2010-08-05
VORB: 0.74 * 6.69 * 0.53 = 2.62
---------------------------------------------------------------
Name: Parc Restaurant, Bistro & Cafe
URL: http://www.yelp.com/biz/parc-restaurant-bistro-and-cafe-philadelphia
Avg rating: 3.93
Total reviews / Recent reviews: 1021 / 613
Open date: 2009-01-20
VORB: 0.63 * 6.93 * 0.60 = 2.62

I imagine the VORB score could be better. Also, this list could be adjusted taking into account other important factors such as price. If you have ideas, your welcome to take a stab yourself. All the code and data is here.