The Battle of Neighborhoods in the city of Toronto.

Lakshya Bansal
4 min readJun 23, 2020

--

Toronto City

Introduction

The purpose of this project is to help people in exploring better facilities around their neighbourhood. It will help people making smart and efficient decisions on selecting great neighbourhoods out of numbers of other neighbourhoods in city Toronto. The project aim is to group similar neighbourhoods into clusters and then get the mean rating of different categories from each cluster and compare with ratings of other clusters. Which could in return give us a fair idea about the standards of the different facility in different clusters. It will help people to get the awareness of the area and neighbourhood before moving to a new city, state, country or place for their work or to start a new fresh life

Data Description

The city of Toronto is widely populated in Canada, having a wide range of venues of various categories across the city. As per our analysis, we require data for every venue in the city, and we can easily get that using the Foursquare API.

Data Gathering

Postal Codes of different neighbourhoods in the city All the postal codes of Toronto are easily available at https://en.wikipedia.org/wiki/List_of_postal_codes_of_Canada:_M which we can get doing web scraping by using libraries such as BeutifulSoup or pandas.

Details of venues in the different neighbourhoods We need details about different venues in different neighbourhoods of the city of Toronto. For that, we will use the Foursquare API. The Foursquare Places API provides location-based experiences with diverse information about venues, users, photos, and check-ins. The API supports real-time access to places, Snap-to-Place that assigns users to specific locations, and Geo-tag. Additionally, Foursquare allows developers to build audience segments for analysis and measurement. JSON is the preferred response format.

As per the analysis, we will fetch at max 100 venues in a neighbourhood within the range of 500 meters.

Sample Data

Methodology Section

Clustering Approach:

To compare the similarities of the two cities, we decided to explore neighbourhoods, segment them, and group them into clusters to find similar neighbourhoods in a big city like Toronto. To be able to do that, we need to cluster data which is a form of unsupervised machine learning: k-means clustering algorithm.

Using K-Means Clustering Approach

Most Common venues near Neighborhood

Work Flow:

Using credentials of Foursquare API features of nearby places of the neighbourhoods would be mined. Due to HTTP request limitations, the number of places per neighbourhood parameter would reasonably be set to 100 and the radius parameter would be set to 500.

Results Section

Map of Clusters in Toronto

The Location:

Toronto is a popular destination for new immigrants in Canada to reside in. As a result, it is one of the most diverse and multicultural areas in Canada, being home to various religious groups and places of worship. Although immigration has become a hot topic over the past few years with more governments seeking more restrictions on immigrants and refugees, the general trend of immigration into Canada has been one of the rises.

Foursquare API: This project has used Four-square API as its prime data gathering source as it has a database of millions of places, especially their places API which provides the ability to perform location search, location sharing, and details about a business.

Discussion Section

Problem Which Tried to Solve:

The major purpose of this project is to suggest a better neighbourhood in a new city for the person who is shifting there. Social presence in society in terms of like-minded people. Connectivity to the airport, bus stand, city centre, markets, and other daily needs things nearby.

Conclusion

I did this analysis for the Coursera Capstone project, If you want to have the source code of the analysis you can get it from Github.

--

--

No responses yet