Our next post comes from Mason G., superstar intern on our IOS team. While not assembling a 20-monitor wide version of Mario that displays the entire level at once, Mason has been cranking out features for our shiny iPhone and iPad apps. Yelp thrives on data, so it is no suprise that one of Mason's projects was to evaluate the technologies we use for pinpointing users' geolocation. Read on to get the full scoop!
“Checking in” to a business using Yelp’s mobile applications is a fun way for Yelpers to engage with businesses and others in the Yelp community, but we don’t allow users to check in from just anywhere -- they have to earn those badges! In order to make sure everyone’s playing fair, we compare a user’s reported location with the location of the business they’re trying to check in to figure out how far away they are. We thought it would be interesting to figure out how Wi-Fi positioning and accuracy compared to GPS and, in order to do this, we had to take a look at Yelp check-ins from different mobile devices.
First, a little background. A phone can figure out its location in several ways: by using GPS, cell tower triangulation or Wi-Fi positioning. GPS connects to satellites orbiting the Earth, and figures out where it is compared to the satellites. Cell tower triangulation connects to nearby cell towers, and performs a similar calculation. Wi-Fi positioning depends on companies like Skyhook, who record the locations of Wi-Fi networks. Your phone can then look at nearby Wi-Fi networks and figure out where it is.
Using Yelp’s open-source map reduce framework, mrjob, we analyzed all Yelp check-in data from June 2012, breaking it out by device type. Android and iPhone can use GPS, cell tower triangulation and nearby Wi-Fi networks to get a precise fix. On the other hand, iPods can only use Wi-Fi positioning. By comparing iPods to Android and iPhones, we were able to see how accurate Wi-Fi positioning is in comparison to a mix of all three techniques.
After gathering all the data from June, we graphed a probability distribution function of Yelp check-ins versus distance in order to see the distance between users and the businesses they’re checking in to. This graph shows the percentage of check-ins attempted (y-axis) at a given reported distance from a business (x-axis). As you can see, check-ins from iPhones tend to be closest to the business, followed by Android phones and iPods.
Next we converted this graph into a cumulative distribution function, in order to see how many Yelp check-ins occurred within a specific distance from the business. iPhone fared better than Android, likely due to lower-quality GPS chips in some Android devices. For example, 7.5% of Yelp check-ins from Android, the phone thought that the user was actually more than two miles away from the business, while only 4.5% of iPhone check-ins were that far away.
For example, 79% of iPod check-ins were less than one mile from the business.
When checking in, we also record the reported location inaccuracy. This number represents the phone’s best guess at the number of miles it might be off by. We account for this inaccuracy by subtracting the number from the distance to the business. This way users don’t miss out on the chance to check in.
The dot shows your reported location, and the larger circle represents the inaccuracy.
Android devices gain the most from this comparison, although iPhones still have better location services overall. However, the iPod line barely moves – the reported accuracy is always close to 0.
For example, 90% of Android check-ins were less than one mile from the business after adjusting for the accuracy radius.
By analyzing millions of data points, we can easily see how, on average, different platforms perform. iPhones consistently have the most accurate positioning, with a fairly small accuracy radius. Android phones are often inaccurate, but reliably reported that inaccuracy. And finally, iPods using Wi-Fi positioning proved the least accurate and usually reported incorrect accuracy radii. We can use this analysis to make sure that users have a great experience checking in, no matter their device.