CALIFORNIA TRAVEL GUIDE
Table of Content
IntroductionI. Data Wrangling
II. Analysis and Vistualization
III. Review Analysis
IV. Interactive User Input
Conclusion & Next Step
Codes
Introduction
This webpage provides an overview of the final project that we did for the STA 141B class. The contributors of this projects are:
Stephanie (Hiu Man) Lam,
Chloe (Jieyi) Chen,
and Janet Loyola
We divided our project into 4 parts, which include data wrangling and anaylsis, vistualization, review analysis, and interactive user input.
At the end of this page, we will provide links to the Jupyter Notebooks where the codes locate.
With our passion of traveling, we are interested in helping visitors to create an ideal travel plan in California. Specifically, we will be focusing on only 3 categories:
- hotels, restaurants, and landmarks.
The Techniques that we use are web data processing, interactive data vistualization, natural language processing, and interactive user input using Python.
I. Data Wrangling
Extracted and collected data from the Yelp Search API and performed a web scraping from Wikipedia page, we created a dataframe with business and California cities information.
The head of our final dataframe for the category restaurant:
| Categories | City | Phone Number | ID | Claimed? | Closed? | Mobile url | Name | Rating | Review Count | Snippet Text | URL | population | Lat. | Lon. |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| [[Burgers, burgers]] | Adelanto, CA | +1-760-246-4813 | bravo-burgers-adelanto | False | False | https://m.yelp.com/biz/bravo-burgers-adelanto?... | Bravo Burgers | 2.5 | 37 | We had dinner at Bravo Burgers tonight... | https://www.yelp.com/biz/bravo-burgers-adel... | 31,765 | 34.582769 | -117.409214 |
| [[[Tacos, tacos]] | Adelanto, CA | NaN | jds-tacos-adelanto-2 | False | False | https://m.yelp.com/biz/jds-tacos-adelanto-2?ad... | Jds Tacos | 5.0 | 1 | Jds tacos coming soon on Friday we... | https://www.yelp.com/biz/jds-tacos-adelanto-2?... | 31,765 | 34.582769 | -117.409214 |
| [Mexican, mexican]] | Adelanto, CA | +1-760-246-4751 | miguelitos-family-restaurant-adelanto | False | False | https://m.yelp.com/biz/miguelitos-family-resta... | Miguelitos Family Restaurant | 4.0 | 14 | This is the place to come after a night... | https://www.yelp.com/biz/miguelitos-family-res... | 31,765 | 34.582769 | -117.409214 |
| [[Thai, thai], [Chinese, chinese]] | Adelanto, CA | +1-760-246-8122 | thai-siam-restaurant-adelanto | False | False | https://m.yelp.com/biz/thai-siam-restaurant-ad... | Thai-Siam Restaurant | 4.5 | 42 | So I wanted to listen to "In the Aero... | https://www.yelp.com/biz/thai-siam-restaurant-... | 31,765 | 34.582769 | -117.409214 |
II. Analysis and Vistualization
Since we want our users to be able to keep track of the different categories that they might be interested in, we used interactive plots to provide a better user experience.
The Restaurant Category
Since there are many different categories in restaurants, we will only focus on the top 10 most frequent cateogries. From this bar plot, we can see that Mexican food is the most popular cuisine.Now, we need a plot to see how these categories are distributed in different ratings.
We see that most of the restaurants have 4 stars rating or higher. Hence, we can tell that CA has pretty good restaurants overall.
In this map,The bigger dots indicate higher average review count. We see that most of the restaurants in different cities are between 4 and 4.5 stars. There is no city that has an average rating higher than 4.5.
Since we want our users to be able to look at the top 3 restaurants' locations based on the cuisine that they are interested in, we created functions to extract the top 3 restaurants by cuisine and plot the locations on a map Most of the top 3 restaurants are located near San Francisco and in the Los Angeles to San Diego area.
The Hotel Category
We discovered that the dataframe extracted from Yelp contain categories that are not hotels. Therefore, in order to get a more accurate analysis, we have searched through the dataset and extracted only hotel informaiton. Then, we used pie chart to show the star distribution and a map to show the average rating in each city. From the pie chart, we see that the majority of the hotels are between 3 to 4 stars. There are only 3.04% of all the hotels are rated 5 stars while 26.7% are 3.5 stars. Compared to the restaurants category, there are many cities that have an average hotel rating that is between 1 - 3 stars. There are only 2 red dots in the map: the dot in Exeter is very small and the average reviews count is only 14. Therefore, even though it has an average of 4.5 rating in the city, there might be only one hotel in that city. On the other hand, the hotels in Palm Spring are popular because the average review counts are pretty high. We grouped the hotels into different categories by finding the pattern within their name such as Hotel, Motel, or Inn. Same as the restaurant category, the map shows that the top hotels are located near San Francisco and LA-SD area.The Landmarks Category
From the pie chart, most landmarks seem to have high rating and they are ranged from 4 to 5 stars. Since we focused on only the landmarks and historical buildings category, there is no pattern in their names, we found and plotted the top 10 landmarks in California instead. From the previous plot and this map, we see that the landmarks have much more cities that are highly-rated and the majority of them have high average review count. Unlike the restaurant and hotel category, half of landmarks are located in San Francisco while Los Angeles does not have any out of the top 10 landmarks.III. Review Analysis
We used natural language processing to analyze the reviews from the Yelp API and find the common words that are used in the review by analyzing the best rated nearby restaurants, hotels and landmarks for all the cities in California. The results are shown below:
For restaurants:
For Hotels:
For Landmarks:
IV. Interactive User Input
With the application of interactive user input functions, we want to provide a basic info of the city and the best recommendations of restaurants, hotels and landmarks to the users based on their preferences. Below are the sample results that we got from the functions:
Sample User Input:Please enter the city that you want to visit: san fransicso
Sample User Output:
Welcome to the city of San Francisco! We are excited to provide you an ideal travel guide to help you explore this wonderful city!
Here is some basic info of the city of San Francisco!
San Francisco (SF) (/sæn frənˈsɪskoʊ/, Spanish for Saint Francis; Spanish: [san fran.ˈθis.ko]), officially the City and County of San Francisco, is the cultural, commercial, and financial center of Northern California. It is the birthplace of the United Nations.[23][24][25] Located at the north end of the San Francisco Peninsula, San Francisco is about 47.9 square miles (124 km2)[17] in area, making it the smallest county—and the only consolidated city-county[26]—within the state of California. With a density of about 18,451 people per square mile (7,124 people per km2), San Francisco is the most densely settled large city (population greater than 200,000) in California and the second-most densely populated major city in the United States after New York City.[27] San Francisco is the fourth-most populous city in California, after Los Angeles, San Diego, and San Jose, and the 13th-most populous city in the United States—with a census-estimated 2015 population of 864,816.[20] The city and its surrounding areas are known as the San Francisco Bay Area, and are a part of the larger OMB-designated San Jose-San Francisco-Oakland combined statistical area, the fifth most populous in the nation with an estimated population of 8.7 million.
| info |
|---|
| Motto: Oro en Paz, Fierro en Guerra (Spanish) ... |
| State : California |
| CSA : San Jose–San Francisco–Oakland |
| Metro : San Francisco–Oakland–Hayward |
| Incorporated : April 15, 1850 |
| Founded by : José Joaquin Moraga : Francisco P... |
| Named for : St. Francis of Assisi |
| Type : Mayor-council |
| Body : Board of Supervisors |
| Mayor : Edwin M. Lee (D) |
| Supervisors : List : Sandra Lee Fewer (D) : Ma... |
| Assembly members : David Chiu (D) : Phil Ting (D) |
| State senator : Scott Wiener (D) |
| United States Representatives : Nancy Pelosi (... |
| City and county : 231.89 sq mi (600.6 km2) |
| Land : 46.87 sq mi (121.4 km2) |
| Water : 185.02 sq mi (479.2 km2) 80.00% |
| Metro : 3,524.4 sq mi (9,128 km2) |
| City and county : 864,816 |
| Rank : 13th, U.S. |
| Density : 18,451/sq mi (7,124/km2) |
| Metro : 4,656,132 (11th) |
| CSA : 8,713,914 (5th) |
| Summer (DST) : Pacific Daylight Time (UTC−7) |
| Area codes : 415/628 |
| GNIS feature IDs : 277593, 2411786 |
Sample Input:
Which accommondation do you want us to recommend? For example, restaurants, hotels or landmarks: restaurants
What is your favorite kinds of food? chinese
What is your preferred range of rating for restaurants? 1,4
Sample Ouput:
You enter City: San Francisco, CA, Restaurant Category: Chinese, Lower_bound Rating: 1, Upper_bound Rating: 4
We are sorry. We can not find a restaurant that meets your criterias in our database. Please try a different kinds of food or rating. But first, let's look at the TOP 5 alternatives that we find.
| categories | city | name | rating | review_count | snippet_text | url |
|---|---|---|---|---|---|---|
| Ramen | San Francisco, CA | Hinodeya Ramen Bar | 4.0 | 182 | Yum. Another ramen bar! With, of course, a wai... | https://www.yelp.com/biz/hinodeya-ramen-bar-sa... |
| Ramen | San Francisco, CA | Nojo Ramen Tavern | 4.0 | 230 | There was no wait for lunch on a weekend. The ... | https://www.yelp.com/biz/nojo-ramen-tavern-san... |
| Japanese | San Francisco, CA | Kui Shin Bo | 4.0 | 478 | At this point the wife and I have been out of ... | https://www.yelp.com/biz/kui-shin-bo-san-franc... |
| Cocktail Bars | San Francisco, CA | Horsefeather | 4.0 | 82 | Solid place for reasonably priced fancy cockta... | https://www.yelp.com/biz/horsefeather-san-fran... |
| Seafood | San Francisco, CA | Fog Harbor Fish House | 4.0 | 2920 | First I have to tell you that I usually don't ... | https://www.yelp.com/biz/fog-harbor-fish-house... |
Sample Input:
Are you satisfied with the results? no
Ok, let's try again.
Which accommondation do you want us to recommend? For example, restaurants, hotels or landmarks: restaurants
What is your favorite kinds of food? japanese
What is your preferred range of rating for restaurants? 3,5
Sample Ouput:
You enter City: San Francisco, CA, Restaurant Category: Japanese, Lower_bound Rating: 1, Upper_bound Rating: 4
| categories | city | name | rating | review_count | snippet_text | url |
|---|---|---|---|---|---|---|
| Japanese | San Francisco, CA | Kui Shin Bo | 4.0 | 478 | At this point the wife and I have been out of ... | https://www.yelp.com/biz/kui-shin-bo-san-franc... |
| Japanese | San Francisco, CA | OzaOza | 5.0 | 31 | This was our first kaiseki experience and we a... | https://www.yelp.com/biz/ozaoza-san-francisco?... |
Sample Input:
Which accommondation do you want us to recommend? For example, restaurants, hotels or landmarks: hotels
What is your favorite kinds of food? hotels
What is your preferred range of rating for restaurants? 1,4
Sample Ouput:
You enter City: San Francisco, CA, Restaurant Category: Hotels, Lower_bound Rating: 1, Upper_bound Rating: 4
| categories | city | name | rating | review_count | snippet_text | url |
|---|---|---|---|---|---|---|
| Hotels | San Francisco, CA | Hotel Abri | 4.0 | 273 | Love!\n\nEasy to book online, we arrived and t... | https://www.yelp.com/biz/hotel-abri-san-franci... |
| Hotels | San Francisco, CA | Union Hotel | 4.0 | 25 | Ok. Here it goes: I visited San Francisco, and... | https://www.yelp.com/biz/union-hotel-san-franc... |
| Hotels | San Francisco, CA | Hotel Del Sol | 4.0 | 120 | Pros:\n-super family friendly\n-kids loved the... | https://www.yelp.com/biz/hotel-del-sol-san-fra... |
Sample Input:
Are you satisfied with the results? Yes
Sample Ouput:
Thanks for using our system. We wish you have a wonderful trip.
Conclusion & Next Step
This travel guide has provided a comprehensive analysis for most restaurants, hotels and landmarks in California and make recommendations based on the users' preferences. Our next step will be creating a website that gets the user inputs displays the recommendations and plots. We will need to find a larger database that will contain more information and a web server that allows dynamic content. Furthermore, we will use this project as a template to create travel guides for other states as well.
Code
The links below are the html form of project jupyter notebooks, each file would include the codes and results that we used in the project.











