I plan to relocate to Singapore, which part of the district would I choose?
By: Ilmi Katiman
Tags: Data Science, IBM, Clustering, Folium, Machine Learning

I plan to relocate to Singapore, which part of the district would I choose? Ilmi Katiman Feb 7·7 min read

IBM Data Science Final Capstone

IBM Data Science Capstone Project

I plan to relocate to Singapore, which part of Singapore should I choose?

Ilmi Nadhrah Katiman

February 7, 2021

1. Introduction

The IBM Data Science Professional certificate course on Coursera concludes with a Capstone Project. This project is about using data science toolset on a real-life problem and demonstrating the creation of value by applying the learned skills. This report presents this capstone project. The analysis was performed in Python.

2. Problem Definition

2.1 Description of the project

Singapore, officially the Republic of Singapore, is a sovereign island city-state in maritime Southeast Asia. It has the second greatest population density in the world. The country has almost 5.7 million residents, 61% (3.4 million) of whom are Singaporean citizens.

After early years of turbulence and despite lacking natural resources and a hinterland, the nation rapidly developed to become one of the Four Asian Tigers based on external trade, becoming a highly developed country; it is ranked ninth on the UN Human Development Index, and has the second-highest GDP per capita (PPP) in the world. Singapore is the only country in Asia with an AAA sovereign rating from all major rating agencies. It is a major financial and shipping hub, consistently ranked the most expensive city to live in since 2013, and has been identified as a tax haven. Singapore is placed highly in key social indicators: education, healthcare, quality of life, personal safety and housing, with a home-ownership rate of 91%. Singaporeans enjoy one of the world’s longest life expectancies, fastest Internet connection speeds and one of the lowest infant mortality rates in the world.

2.2 Project Objective

With its stable climate all year round, Singapore attracted highly skilled individuals and families as a hub of working and living a decent life. It will only took an individual 4 hours’ drive along 161 kilometers to complete tour of the city.A family with children planning to move to Singapore would want to consider venue that suits the whole family as a place of living.

In this project we will try to analyze all the venues in Singapore’s different region, divide them according to clusters to recommend a place that would be suitable for a family moving to Singapore.

2.3 Problem Statement

Here in our project we will check all the venues available that are present in different region of Singapore. We will analyse the data Singpore’s region and see where venues are in highest number. We will check the proximity of each venue according to Folium maps.We hope to answer “I plan to relocate to Singapore, which part of Singapore should I choose?

2.4 Target Audience

Who all will be beneficial from this project :

A family planning to move to Singapore. For the first year, mother wanted to stay at a place near to many interesting venues.

Reasons:

1) They have 5 children, children love to eat.

2) They do not have a car and planning to commute by public transport.

2.5 Assumption

The assumption behind the analysis is that we can use unsupervised machine learning to create clusters of regions that will provide us with a list of areas for consideration for the family. The intent is that the family to be situated close to myriad options of venues to choose.

3. Data

To perform this analysis, we will need the following data:

1) List of region in singapore, with their latitude and longitude

Singapore region, along with its cities can be retrieved from this site:

https://simplemaps.com/data/sg-cities

For scraping the data we will be using python.

2) Interesting venues in Singapore registered in Foursquare.

Data : from Foursquare API, with the help of folium map.

Visualize the data in form of Boundary Map.

1. Methodology

a. Use of data and a high-level roadmap

After tidying up and exploring the data, we will apply the K-means machine learning technique for creating clusters of districts. We will use the silhouette score for choosing the optimal number of clusters.

b. Analysis

i. Data Preparation and exploration

As part of preparing the data, we start by creating a list of districts in Singapore and add the geo-coordinates of each district to this table. That is done by first importing a list of districts and then using this list and geocode python library, we add the latitude and longitude coordinates to each district. After performing this task, we get the following table that we use in pandas dataframe format.

There are 73 cities in Singapore and we were able to summarize their latitude and longitude.

In the next step, we create a visual representation of how the citites are situated Singapore. For this, the folium library was used.

In the next step of the analysis, the districts were explored in greater detail. It means venues were collected for each district via Foursquare API. The data from Foursquare is received in json format. After arranging the data, we have up to 10 venues for each district. Venues are collected within a radius of 500 meters from the point of district coordinates. The collected and arranged data looks like this. The following table shows some venues from the first district.

We can check how many venues have been collected for each district. The following table gives that summary.

For analysing the districts, we focus on venue categories. For that purpose, we use the one-hot encoding. This creates dummy variables for categories so the data set could be used for machine learning.

After performing manipulations with the dataset, we get the following table, which shows the top ten most common venues for each district (first four shown in the table).

ii. Clustering

Now that we have the dataset ready, we perform clustering. For this, unsupervised machine learning technique will be used based on K-means. For K-means clustering, we need to decide on the number of clusters that we want to use. To avoid the trial and error approach, the silhouette score was used. The following graph shows the silhouette scores for a range of clusters variations.

From the graph, we can read that the optimal number of clusters to use is 2 (where the score is the highest). In the next step, we run the K-means clustering algorithm with the parameter of 2 as the number of clusters. When done, we add the cluster labels to the dataset. We get the following table.

Also, we can visualise the clusters on the map that we created earlier.

4. Results

Understanding the Clusters

By looking at the cluster data, we can see that there are 2 clusters that we can consider to look on.

1. Cluster 1

The first cluster (Cluster label 0) is the larger area of Singapore map, with large number of café and coffee shops, food court and numerous Chinese restaurant. (Looking at first to third most common venue)

2. Cluster 2

Cluster 2 (Cluster label 1) is the smaller cluster, but this is where we common public transport most common (bus station), numerous fast food restaurant and vegan restaurant.

5. Discussion and Recommendations

Based on what we learned about the clusters, we can advise the family to consider the districts from cluster 2 as a potential location for their family. These are the districts where public transport is easily accessible and also good eataries for kids (fast food and ice cream shops). These satisfy the two original criteria that the location should accessible as they do not plan to buy car and plenty of good food around.

4. Conclusion

This paper discussed the process of coming up with an answer for a hypothetical though

real-life like business problem. The analysis was performed based on the toolset of data science and relied heavily on the use of Python and Python libraries such as Pandas, Scikit, Folium to name a few. Data was collected from a different type of sources and in different formats. For analysis, machine learning technique was used. The output of the analysis provided a thorough base for the recommendation for the business problem in question. Cluster 2 which is situated in the East Regiom of Singapore, is the recommended place to stay for the family.

5. References

The Jupyter notebook of the analysis can be found on GitHub.

https://github.com/ilminadhrah/Coursera_Capstone/blob/main/Final%20Project%20Capstone.ipynb