Analyzing and Predicting optimal locations for opening popular restaurants in Chennai city
By: Mohammed Ismail P
Tags: IBM, Professional Certificate, Data Science, Restaurant, Coursera

Analyzing and Predicting optimal locations for opening popular restaurants in Chennai city

This blog post is a part of the IBM Data Science Professional Certificate, assignment named “The Battle of Neighborhoods” under Applied Data Science Capstone.

Table of contents

Introduction

Data Acquisition

Methodology

Analysis

Result

Discussion

Conclusion

Reference

A. Introduction

A.1. Background

Chennai, also known as Madras, is the capital of the Indian state of Tamil Nadu. Located on the Coromandel Coast of the Bay of Bengal, it is one of the largest cultural, economic, and educational centers of south India. According to the 2011 Indian census, it is the sixth-most populous city and fourth-most populous urban agglomeration in India. The Chennai Metropolitan Area is the 36th-largest urban area by population in the world. Chennai ranked the 36th-most visited city in the world for the year 2019. The Quality of Living Survey rated Chennai as the safest city in India. Chennai has the fifth-largest urban economy in India.

The diversity of the cuisine available is reflective of the social and economic diversity of Chennai. Indian, Chinese, Asian, Italian, Middle Eastern, Thai are some of the most popular in the city. We will analyze each of these restaurants to predict a suitable location for the respective restaurant.

A.2. Problem Definition

Since there are lots of restaurants in Chennai, we try to select those locations that are not already crowded with restaurants within the region and have a greater population. Due to low restaurant density, the chance of setting up a new restaurant might be a great success.

A.3. Interest

In particular, the concluded analysis will target stakeholders who want to set up one of the popular restaurants in Chennai, Tamil Nadu, India. We will use various data science and analysis techniques to reach our goal of selecting optimal locations. The advantages of each area will then be clearly expressed so that the best possible final location can be chosen by stakeholders.

B. Data acquisition

The data and their respective data sources that are helpful for our is discussed below,

Chennai city’s major areas and neighborhoods are provided by Wikipedia web page.

Geographical coordinates of the areas are provided by Python’s geocoder library.

Venues in each locality of Chennai city are provided by Foursquare API. The coordinate information is used by the Foursquare API to fetch the venues within the specified radius and venue limits.

C. Methodology

First, we initialized a crawler to scrape the data about the areas of Chennai city, from the Wikipedia web page. A total of 163 neighborhood names are extracted. We then utilized python’s geocoder library, with ArcGIS as a geocode provider, to get the coordinates of the neighborhoods. Sample data is shown as,

Chennai city’s Neighborhood with their coordinates

The neighborhoods are visualized using python’s folium package. This allows us to perform a sanity check to make sure that the geographical coordinate’s data returned by the geocoder are plotted correctly. Map of Chennai city along with the neighborhood is shown as,

Chennai city map with neighborhoods

Then, the coordinates data is used by the Foursquare API to fetch information about all the venues within the specified radius (we used the radius of 1500 meters), in each of the neighborhoods of Chennai city, targeting only the relevant information like Venue name, Venue coordinate, and Venue Category. Chennai city has a total of 211 unique venue categories and 1864 venues, which includes various restaurants, Shopping malls, Multiplex, etc., In the end, we get a table as,

Neighborhoods with surrounding venue details

We then use one-hot encoding which allows the representation of categorical data to be more expressive. Many machine learning algorithms cannot work with categorical data directly. In our case, venue categories grouped by the neighborhood and are expressed as the mean of the frequency of occurrence of each category. Sample data is shown as,

Venue density distribution in each neighborhood

We then apply the clustering algorithm, KMeans, on the above data to cluster the neighborhood based on general venue density and analyze & compare the sets in each cluster to conclude the most promising and optimal locations for each restaurant type. We then filter out only the target restaurant of interest in each neighborhood, to analyze within the clusters.

D. Analysis

After segmenting the neighborhood, within each cluster, we will target those neighborhoods that have less than 20% of the entire restaurant density and no target restaurant. We identified 4 as optimal cluster value to group similar neighborhoods according to the Silhouette score, which computes the mean Silhouette Coefficient of all samples. After applying the KMeans clustering algorithm, all the neighborhoods get separated and the resulted sample output is shown as,

Venue density with Cluster label in each neighborhood

The clusters are visualized using python’s folium package. The cluster with 4 different colors along with the cluster legends is shown as,

Chennai city map with clustered neighborhoods

E. Result

After thoroughly analyzing the clusters and their respective neighborhoods, the findings are concluded as follows,

E.1. Cluster 0

Cluster 0 has a total of 57 neighborhoods. It has full of restaurants and other food shops. Opening a new restaurant in an already established market is not a good idea. Only 8% of the areas have the opportunity to open new restaurants. Pie chart that depicts the proportion of each restaurant type in cluster 0 is shown as,

Proportion of restaurants in Cluster 0

E.2. Cluster 1

Cluster 1 has a total of 14 neighborhoods. It has a high market density with fewer medium popular restaurant types. This cluster can be considered as one of the optimal places to open medium popular restaurant types. About 74% of the area has a promising opportunity for opening a new restaurant. Pie chart that depicts the proportion of each restaurant type in cluster 1 is shown as,

Proportion of restaurants in Cluster 1

E.3. Cluster 2

Cluster 2 has only 3 neighborhoods. It has negligible restaurant density. Opening a new restaurant in this cluster can be profitable. 2 out of 3 areas do not have a single restaurant. Pie chart that depicts the proportion of each restaurant type in cluster 2 is shown as,

Proportion of restaurants in Cluster 2

E.4. Cluster 3

Cluster 3 has a total of 83 neighborhoods. It is very similar to Cluster 0 with high restaurant density. About 36% of the areas have the opportunity to open a new restaurant. Pie chart that depicts the proportion of each restaurant type in cluster 3 is shown as,

Proportion of restaurants in Cluster 3

More detailed analysis can be found in the project report.

F. Discussion

There are some clusters that do not have some specific restaurant type. For example, Cluster 1 does not have a single Asian and Italian restaurant, and Cluster 2 does not have a single Fast Food restaurant. Thus, opening these types of restaurants has the high possibility of success as well as failure, due to various factors like populations, income of residents, financial reports, etc., Thus further analysis and survey of these areas of interest are needed to be done before taking further actions.

We can also apply the same approach for the larger dataset. This approach can also be applied to identify the promising locations for other venues like shopping malls, movie theatres, salons, and other related businesses. In this project, we considered only one factor, that is, venue density distribution. There are some other factors like population and income of residents, real estate availability, surrounding localities, financial report, etc., that can be really helpful to further narrow down the choice of selecting the optimal locations with a more accurate analysis.

G. Conclusion

To summarize, the purpose of this analysis was to identify the optimal locations for opening some of the popular restaurant types namely, Indian, Fast Food, Vegetarian, Chinese, Asian and Italian restaurants. Factors like venue density distribution are used to achieve our task.

First, we scraped the neighborhood information of Chennai city from the Wikipedia website and used python’s geocoder library to get the coordinate information of each of the neighborhoods. Then, we utilized Foursquare API to fetch and identify all the venues within each neighborhood provided the radius. We then clustered the neighborhood based on the venue density distribution. Each cluster provided useful information and insights about the venues and restaurants that are briefly discussed in the analysis and result section of the project report, which is helpful for the stakeholders.

The final decision on selecting the optimal location for the restaurant will be made by stakeholders based on specific characteristics of neighborhoods and locations, like competition, future growth, Health regulations, Safety / Crime rates, and taking additional factors into consideration that are discussed above.

H. Reference