best neighborhood using K-Means cluster

The city that will do the clustering method on is Madinah

AL madinah city is one of the holy cities for muslims which have the prophet Mohammed mosque that a lot of muslims visit it every year, so this report is going to help visitors to choose the place that has the most venues nearby by clustering using the machine learning KMeans clustering method.

Choosing the right place like nearest (Hotels, Restaurants, Coffee shops and Stores ) is sometimes hard for visitors to choose. By using data analyses and machine learning will help the visitors to choose the right place.

Data

Getting the PostalCode, Neighborhood, Latitude and Longitude from Google Maps.

Table 1. Google maps postal codes data

Getting this data give the ability to get (Venue, Venu Latitude, Venu Longitude, Venu Category) from foursquare

Table 2. Foursquare venus data

Data cleaning

Data downloaded or scraped from multiple sources must be cleaned and fill the missing values and combine the tables into one table.

First grouping the venue count data by the Neighborhoods to calculate how many venues in every Neighborhood.

Table 3. Groupby Neighborhood

Then combine the two tables into one table with the maen values of all of the values.

Table 4. combine the two tables

Data Analysis and visualization

Showing in the bar chart below that the most neighborhood that has more venues is (Bada’ah) neighborhood.

Figure 1. bar chart

Modeling

In this project used K-Means clustering which can group data only unsupervised based on the similarity of the data.

Using this methodology to group the venues of Madinah city neighborhood data to different clusters, the tools that used to calculate the K-Means is Sklearn with Python.

  • Adding the cluster labels to the dataframe
Table 5. clustering
  • Using the map to visualize the clusters
Figure 2. The map of madinah city with clustering

Conclusion

As we built our list of neighborhoods with Restaurant venues exclusively we discovered most neighborhoods were similar and the greatest concentration of restaurants was in Madinah.

This helps visitors to choose the right neighborhood after clustering results.

Github: https://github.com/faisalhani/Visit-Madinah-City-Kmeans-Clusters/blob/main/Visit-Madinah-City-Kmeans-Clusters.ipynb

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store