Series Hyper Phronesis: Data Science Capstone Project
Map Risk Clusters of Neighbourhoods in the time of Pandemic (a case of the city of Buenos Aires): Three Different Lessons from Three Clustering Analyses
Published: August 22, 2020 by Michio Suginoo
Introduction
Every year is unique and particular. But, 2020 brought the world the special planetary pandemic challenge of COVID-19. It spread and penetrated rapidly into different parts of the globe. And, the autonomous city of Buenos Aires (CABA: Ciudad Autonoma de Buenos Aires) is not an exception.
In this particular setting, I contemplated for the capstone project a hypothetical corporate client in the food industry from abroad (The Client), that is planning to relocate their representative family to the city of Buenos Aires for their future penetration into Argentina once the pandemic-related restrictions are lifted. Since this would be its very first entry to Buenos Aires, the city is still an unknown territory for the Client. Very concerned with the two risks—the general security risk (crime) and the pandemic risk (COVID-19)—the Client wants to exclude high risk neighbourhoods in the selection of the location for the relocation plan.
In addition, the Client wants to capture the characteristics of neighbourhoods by popular commercial venue categories such as restaurants, shops, and sports facilities. In this context, the Client hired me as an independent consultant to conduct a preliminary research for its future plan. The Client sets the following three objectives for this assignment.
Identify outlier high risk neighbourhoods (the Outlier Neighbourhood/Cluster) in terms of these two risks—the general security risk (crime) and the pandemic risk (COVID-19).
Segment non-outlier neighbourhoods into several clusters (the Non-Outlier Neighbourhoods/Clusters) and rank them based on a single quantitative risk metric (a compound risk metric of the general security risk and the pandemic risk).
Use Foursquare API to characterize the Non-Outlier Neighbourhoods regarding popular venues. And if possible, segment Non-Outlier Neighbourhoods according to popular venue profiles.
In addition, the Client demonstrated high enthusiasm about Machine Learning and requested me to use machine learning models to achieve all these objectives.
The autonomous city of Buenos Aires is a densely populated city: the total population of approximately 3 million in the area of 203 km2. And each neighbourhood has its own distinct size of area and population. The city is divided into 48 administrative division, aka ‘barrios’, to which I will refer simply as ‘neighbourhoods’ in this report.
The Client expressed their concern about the effect of the variability of population density among neighbourhoods. These two risks of the Client’s concern—the general security risk (crime) and the pandemic risk (COVID-19)—are likely affected by the population density profiles. Especially, the fact that ‘social distancing’ is a key to the prevention of COVID-19 suggests that population density is a significant attribute for the pandemic risk. In other words, the higher the population density, the higher the infection rate. The similar can be true for the general insecurity. Obviously, this preconception needs to be assessed based on the actual data in the course of the project. Nevertheless, the Client made a request to scale risk metrics by ‘population density’. This needs to be kept in mind for the analysis.
This blog is intended to outline some highlights of my capstone project for Coursera IBM Data Science Professional Certification Program. On one hand, the scenario setting is totally hypothetical. On the other hand, the project handles real data. The details of the project could be viewed in the following links:
In this section, I will outline the data requirements, present data sources, and highlight my findings of the data gathered for the analysis.
A1: Data Requirements The three objectives clearly set by the Client determine the data requirements as follow:
1. Basic information about the neighbourhoods in Buenos Aires.
The area and the population for each neighbourhood
The geographical coordinates to determine the administrative border of each neighbourhood (for map visualization)
2. Risk statistics: For the first and the second objective stated in Introduction section, I would need to gather the following historical statistics to construct a compound risk metric to profile neighbourhoods from the perspectives of both the general insecurity risk (crime) and the pandemic risk (COVID-19).
general security risk statistics (crime incidences) by neighbourhoods
pandemic risk statistics (COVID-19 confirmed cases) by neighbourhoods
3. Foursquare Data: For the third objective, the Client requires me to specifically use Foursquare in order to characterise each Non-Outlier Neighbourhood.
A2. Data Sources Now, I would like to clarify the data sources that meet the data requirements.
3. Foursquare Data for Popular Venues by Neighbourhood: as per the Client’s requirement to specifically use Foursquare API in order to characterise each Non-Outlier Neighbourhood.
A3. Data Collection
After downloading all the relevant data from the data sources above, I have made data reconciliation—cleaning it, transforming it, and reconcile some common data among different datasets. Thereafter, I consolidated all the data into two datasets: “Risk Profile of Neighbourhoods” dataset and “Foursquare Venue Profile” dataset. The first 4 rows of each dataset are presented below to illustrate their components.
The first 4 rows of “Risk Profile of Neighbourhoods”:
The first 4 rows of “Foursquare Venue Profile”:
Here is an outline of data limitation below.
1) Crime Statistics: “Crime Severity Score” The compiled crime data covers only the period between Jan 1, 2016 and Dec 31, 2018. For the purpose of the project, I would make an assumption that the data during the available period would be good enough to serve a representative proxy for the risk characteristic of each neighbourhood. The original crime statistics had 7 crime categories. They were weighted according to the severity of crime category and transformed to generate one single metric “Crime Severity Score”.
2) COVID-19 Statistics: “COVID-19 Confirmed Cases” In order to measure the pandemic risk, I simply extracted the cumulative confirmed cases of COVID-19 for each neighbourhood. I did not net out the recovered cases from the data. Thus, the COVID-19 statistics in this analysis is a gross figure. My assumption here is that this will proxy the empirical risk profile of COVID-19 infection.
3) Foursquare Data: Foursquare API allows the user to explore venues within a user specified radius from one single location point. In other words, the user needs to specify the following parameters:
The geographical coordinates of one single starting point ‘radius’.
The radius to set the geographical scope of the query.
This imposes a critical constraint in exploring venues within a neighbourhood from corner to corner. Since there is no uniformity in the area size among neighbourhoods, a compromise would be inevitable, while we want to capture the venue profile of a neighbourhood from corner to corner within its geographical border. Thus, the dataset that I would analyse would be a geographically restrained sample set, but not the population universe. I will use geopy's Nominatim to obtain the representative single location point for each Neighbourhood.
A3. Data Understanding
Now, the next step is data understanding: to get an insight about the given data:
1) “Risk Profile” dataset: For data understanding, there are several basic tools to shape insights about the data distribution. And I performed the following three basic visualizations and generated one basic descriptive statistics:
a) Scatter Matrix: The scatter matrix below displays two types of distribution: 1) the individual distribution of each feature variable on the diagonal cells; and ii) the pair-wise distribution of data points for two feature variables.
Here are some insights that I can derived from the scatter plot:
On the diagonal cells of the scatter matrix, all the data except ‘population density’ demonstrate highly skewed individual distributions, suggesting the presence of outliers.
In the off-diagonal cells, the most of the pair-wise plots suggest positive correlations in one way or another: except ‘population density’ with the area size and ‘COVID-19 Confirmed Cases’.
b) Correlation Matrix: In order to quantitatively capture the second insight above in one single table, I plotted the correlation matrix below.
Overall, “population density” stands out in the sense that it demonstrates relatively lower correlation with other data. This would raise a question: in order to scale these two risk-metrics—'Crime Severity Score (CSS)’ and ‘COVID-19 Confirmed Cases’—is ‘population density’ the best scaler? For example, population demonstrates the highest correlation with these two risk-metrics. This question needs to be reserved for a suggestion for a prospective research.
Nevertheless, as per the Client’s general request to scale the risk metrics by population density, for this project, I scale these two-risk metrics with population density, by simply dividing the two risk-metrics by population density. As result, we have ‘CSS Index’ and ‘COVID-19 Index’. In order to study individual distributions for these newly created indices, I made the following two basic types of visualizations. Here are the charts showing both histogram and boxplot, one pair for ‘CSS Index’ and the other pair for ‘COVID-19 Index’.
c) Histogram: A histogram displays the distribution of data points across a pre-specified number of segmented ranges, bins, of the feature variable. It is useful to capture the shape of the distribution. These two histograms above visually show the presence of outliers.
d) Boxplot: A boxplot displays the distribution of data according to descriptive statistics of percentiles: 25%, 50%, 75%. For our data, the boxplots above isolated outliers above their top whiskers. The tables below present more detailed info about these outliers from these two boxplots.
There are some overlapping outlier neighbourhoods between these two lists. Consolidating them, here is the list of 8 overall risk outliers.
Now, let me plot the neighbourhoods on the two-dimensional risk space: ‘CSS Index’ and ‘COVID-19 Index’. The scatter plot below also helps us confirm these outliers visually.
These simple visualizations and descriptive statistics can be a very powerful tool and it helps us shape an insight about the data at the stage of Data Understanding. In a way, before clustering analysis, the boxplot and the scatter plot have already spotted outliers.
3) “Foursquare Venue Profile” dataset: Here is the summary of the Foursquare response to my query. In order to obtain an insight about the distribution of Foursquare response across different neighbourhoods, the histogram and the boxplot are presented below.
These two plots display the distribution of the Foursquare sample responses. It might suggest that there might be some issues in the coherency of data quality and availability across different neighbourhoods. If that is the case, this might affect the quality of the result of clustering machine learning.
Just in case, I would like to see if there is any relationship between the Foursquare’s response and the three basic profiles of neighbourhoods. I generated the correlation matrix and the scatter matrix.
Here is an intuitive outcome. Venue response has the highest correlation with population density and the least correlation with the area size of neighbourhoods. In other words, the scatter matrix and the correlation matrix suggest that the higher the population density, the more venue information Foursquare has for neighbourhoods. It appeals to our common sense in a way: densely populated busy neighbourhoods have more venues.
For the details for the rest of my work in data collection, data understanding, and data preparation, I would leave it up to the reader to visit the links provided above, if interested.
B. Methodology and Analysis
Now, the data is prepared for analysis. So, I will design methodologies for analysis.
The three objectives set by the Client at the outset and the data availability determine the scope of methodology. Cut a long story short, I run three clustering machine learning models for three different objectives and I got three very different lessons from them.
Before proceeding, let me review the three objectives here.
Identify outlier high risk neighbourhoods (the Outlier Neighbourhood/Cluster) in terms of these two risks—the general security risk (crime) and the pandemic risk (COVID-19).
Segment non-outlier neighbours into several clusters (the Non-Outlier Neighbourhoods/Clusters) and rank them based on a single quantitative risk metric (a compound risk metric of the general security risk and the pandemic risk).
Use Foursquare API to characterize the Non-Outlier Neighbourhoods regarding popular venues. And if possible, segment Non-Outlier Neighbourhoods according to popular venue profiles.
Now, there presents one common salient feature among these three objectives. We have no ‘a priori knowledge’ about the underlying cluster structure of any of the subjects: outlier neighbourhoods, non-outlier neighbourhoods, and popular venue profiles among non-outlier neighbourhoods. Simply put, unlike supervised machine learning models, we have no labelled data to train: we have no empirical data about the dependent variable. All these three objectives demand us to discover hidden labels, or unknown underlying cluster structures in the data.
This feature would naturally navigate us to the territory of unsupervised machine learning, and more specifically, ‘Clustering Machine Learning’.
In this context, for this project, I will put more emphasis on tuning the model a priori rather than pursuing the automation of the a posteriori validation/evaluation process.
As one more important thing to mention in this overview section, we need to normalize/standardize all the relevant data before passing them to machine learning models.
Now, I will discuss the methodologies for each objective one by one.
B1. DBSCAN Clustering for the first objective
The first objective is to identify ‘Outlier Neighbourhoods’. Now, in the scatter plot below, all the neighbourhoods are plotted in the two-dimensional risk space: ‘CSS Index’ vs ‘COVID-19 Index’ space.
In order to identify outliers out of these “two-dimensional spatial data points”, I chose DBSCAN Clustering model, or Density-based Spatial Clustering of Applications with Noise. As its name suggests, DBSCAN is a density-based clustering algorithm and deemed appropriate for examining spatial data. Especially, I am very interested in how the density-based clustering algorithm would process outliers which are expected to demonstrate extremely sparse density.
There are several hyperparameters for DBSCAN. And the one considered as the most crucial is ‘eps’. According to the Skit-learn.org website, ‘eps’ is:
“the maximum distance between two samples for one to be considered as in the neighborhood of the other. This is not a maximum bound on the distances of points within a cluster. This is the most important DBSCAN parameter to choose appropriately for your data set and distance function.” (https://scikit-learn.org/stable/modules/generated/sklearn.cluster.DBSCAN.html)
In order to tune ‘eps’, I will use KneeLocator of the python library kneed to identify the knee point (or elbow point).
What is the knee point?
One way to interpret the knee point is that it is a point where the tuning results start converging within a certain acceptable range. Simply put, it is a point where further tuning enhancement would no longer yield a material incremental benefit. In other words, the knee point determines a cost-benefit boundary for model hyperparameter tuning enhancement.(Source: https://ieeexplore.ieee.org/document/5961514)
In order to discover the knee point of the model hyperparameter, ‘eps’, for DBSCAN model, I passed the normalized/standardized data of these two risk indices—namely ‘Standardized CSS Index’ and ‘Standardized COVID-19 Index’—into the KneeLocator.
And here is the plot result:
The crossing point between the distance curve and the dotted straight vertical line identifies the knee point. Above the chart, KneeLocator also returned the one single value, 0.494, as the knee point. KneeLocator is telling me to choose this value as ‘eps’ to optimize the DBSCAN model. Accordingly, I plug it into DBSCAN. And here is the result.
With this plot, I can confirm that DBSCAN distinguished the sparsely distributed outliers from others, yielding two clusters for the outliers: the cluster -1 (light green) and the cluster 1 (orange). Below, I listed up all the neighbourhoods of these two outlier clusters.
Furthermore, in order to assess if the result at the knee point is good or not, I run DBSCAN with other different values of ‘eps’. Here is the result:
Compared with these various alternative values of ‘eps’, the knee point ‘eps’ gave us a reasonable result automatically. Thus, I will not reject the knee point, the output of KneeLocator, as the value for the hyperparameter, ‘eps’.
When I look at the result of DBSCAN, I realise that this clustering result identifies the same neighbourhoods as outliers as the boxplot visualization performed during the Data Understanding stage. The contents of these two results are identical except for the order of the list. What does it tell us?
Now, the question worthwhile to ask is: if we needed to perform a sophisticated and expensive model such as DBSCAN to identify outliers.
In the perspective of cost-benefit management, the simple boxplot did the same job for the less cost—almost no cost. This might not be true when we have different data: especially, in a high-dimensional datapoints. At least, we should take this lesson in modesty so that we should not underestimate the power of simple methods like the boxplot visualisation.
B2. Hierarchical Clustering for the second objective
Now, the second objective can be broken down into the following core sub-objectives:
Segmentation of ‘Non-Outlier Neighbourhoods’.
Construction of a single compound risk metric to measure both the general security risk and the pandemic risk.
Measuring the risk profile at cluster level (not datapoints/neighbourhoods level).
a) Segmentation of ‘Non-Outlier Neighbourhoods’.
Given the result of the first objective, now I can remove “Outlier Neighbourhoods” from our dataset and focus only on “Non-Outlier Neighbourhoods” for further clustering segmentations.
This time, I choose Hierarchical Clustering model. Here are the reasons why I select this particular model for the second objective:
I have no advance knowledge how many underlying clusters are expected in the dataset. Many clustering models, paradoxically, require the number of clusters as a hyperparameter input to tune the models a priori. But, Hierarchical Clustering doesn’t.
In addition, Hierarchical Clustering algorithm can generate a dendrogram that illustrates a tree-like cluster structure based on the hierarchical structure of the pairwise spatial distance distribution. The ‘dendrogram’ appeals to our human intuition in discovering the underlying cluster structure.
What is a dendrogram?
Seeing is understanding! Maybe. Here you have the dendrogram for our data:
The dendrogram allows the user to study the hierarchical structure of distances among datapoints and the underlying layers of cluster hierarchy. The resulting dendrogram illustrates a tree-like cluster structure based on the pairwise distance distribution. In this way, the dendrogram allows the user to design how many clusters to be made for further analysis. We can visually confirm the hierarchy of the distances among data points and the layers of cluster structure in the dendrogram.
From this dendrogram, I choose 5 (at the distance of 4 in the dendrogram on the x-axis) as the number of clusters to be shaped.
Then, I run Hierarchical Cluster Model for the second time, this time with the specification of the number of the clusters, 5.
Accordingly, I got the 5 clusters of the neighbourhoods.
The following two charts present the clustered neighbourhoods on the two risk-metrics space: one with neighbourhoods’ names and the other without.
As you can see in the scatterplot, the clusters’ ID in the legend does not really represent the risk metric of each cluster. Next, in order to compare these clusters along a risk scale, I will construct one single compound risk metric.
b) Construction of Compound Risk Metric
I need to compress the two risk profiles of clusters (‘CSS’ and ‘COVID-19’) together into one single compound metric in order to achieve one of the Client’s requirement.
For this purpose, I formulated a compound risk metric as follows.
Compound Risk Metric = [(Standardized CSS Index – Standardized Origin of CSS Index)^2 + (Standardized COVID-19 Index - Standardized Origin of COVID-19 Index)^2 ]^1/2 where ^ signifies a power operation: thus '^2' signifies 'squared'.
Although the formula might appear not straightforward, its basic intent is very simple: to measure the risk position of each neighbourhood from the risk-free point in the two-dimensional risk space.
For the raw data, the risk-free point is at the origin of the two-risk-metrics space, which is (0,0): 0 represents no risk in the raw data. The formula above is measuring the risk position of a data point from the risk-free point after the standardization/normalization transformation. It is because in order to pass the data into the machine learning model, the data needs to be normalized/standardized. In that sense, the formula above measures the distance between the standardized data points and the standardized risk-free position. Nothing else. That’s all and simple.
c) Risk Profile of Cluster
Now, my ultimate purpose here is to quantify the risk profile at cluster level, not at data point/neighbourhood level.
Each cluster has its own unique centre, aka “centroid”. Thus, in order to represent the risk profile of each cluster, I can use the risk profile of the centroid for each cluster. In this way, I can grade and rank all these clusters according to the compound risk metric of their centroids.
Accordingly, I measure the compound risk metric of the centroids of all these 5 Non-Outlier Clusters and assign each of them a grade. Here is the result.
The higher the grade, the riskier the cluster.
I merged this result with the master dataset and assigned the cluster grade 6 to the 2 outlier clusters. Then, I mapped these cluster grades of all the neighbourhoods across CABA in the following Choropleth Map.
This map visually summarises the findings for both of these first two objectives. It allows the user to visually distinguish neighbourhood clusters across the autonomous city of Buenos Aires based on their cluster risk grade.
B3. Foursquare Analysis for the third objective
For the third objective, I used Foursquare data to carry out two analyses: Popular Venue Analysis; and Segmentation of Neighbourhoods based on Venue Composition.
a) Popular Venue Analysis:
I apply One Hot Encoding algorithm to reorganize the data structure of venue category for further data transformation.
With Foursquare data, which is venue-base information, I will use Pandas’ “groupby” method to transform it to a neighbourhood-base data and summarise the top 5 popular venue categories for each of 40 ‘Non-Outlier Neighbourhoods’. The result is very long thus, presented in one of the final product at the end of this article.
b) Segmentation of Neighbourhoods based on Venue Profile
Next, I need to segment the Foursquare venue profile of each neighbourhood. For this purpose, I contemplate K-Means Clustering Machine Learning.
I will run two hyperparameter tuning methods—K-Means Elbow Method and Silhouette Score Analysis—to tune its most important hyperparameter, n_clusters, the number of clusters. These tuning methods would give me an insight about how to cluster the data for a meaningful analysis. Based on the finding from these tuning methods, I would decide how to implement the K-Means Clustering machine learning model.
‘K-Means Elbow Method’
The spirit of ‘K-Means Elbow Method’ is the same as the knee point method that I explained earlier. Elbow locates a point where further tuning enhancement would no longer yield a material incremental benefit. In other words, Elbow determines a cost-benefit boundary for model hyperparameter tuning enhancement. Here is the result of K-Means Elbow Method:
As the number of clusters increases, the response does not converge into any range; instead, it keeps dropping. There is no knee/elbow, the cost-benefit boundary, in the entire space. This suggests that there might be no meaningful cluster structure in the dataset. This is a disappointing result.
Silhouette Coefficient Analysis
Silhouette analysis can be used to study the separation distance between the resulting clusters. The silhouette plot displays a measure of how close each point in one cluster is to points in the neighbouring clusters and thus provides a way to assess parameters like number of clusters visually. This measure has a range of [-1, 1].
Cut a long story short, the best value is 1, the worst -1.
Silhouette coefficients (as these values are referred to as) near +1 indicate that the sample is far away from the neighbouring clusters. Which means, the sample is distinguished from the points belonging to other clusters.
A value of 0 indicates that the sample is on or very close to the decision boundary between two neighbouring clusters.
Negative values, (-1,0), indicate that those samples might have been assigned to the wrong cluster.
I run the Silhouette Coefficient Analysis for 4 scenarios: n_cluster = [ 2, 3, 4, 5] to see which value of n_cluster yields the result closest to 1. And here are the results:
All results are close to 0, suggesting that the sample is on or very close to the decision boundary between two neighbouring clusters. In other words, there is no apparent underlying cluster structure in the dataset.
Both K-Means Elbow Method and Silhouette Analysis suggest that we cannot derive an inference about the underlying cluster structure in the data set. It might be due to the characteristics of the city. Or it could be due to the quality of available data.
Whatever real reason it might be, all we know from these tuning results is that there is no convincing implication regarding the underlying cluster structure in the given data. In order to avoid an unreliable, and potentially misleading, recommendation, I would rather refrain from performing K-Means Clustering Model for the given dataset. And I would rather prepare summary materials so that the Client can use their human insight/domain expertise to explore them and identify the popular venue profiles of neighbourhoods.
C. Discussion Part I: Three Different Lessons from the Three Clustering Analyses
I explored three clustering machine learning models for three different objectives set by the Client. And, I came across with quite different results. In this Discussion section, I would like to discuss three different lessons that these three objectives presented.
Lesson from the first objective:
In the course of the data understanding—at an early stage of the project—basic visualizations by the scatter matrix and the correlation matrix illustrated highly skewed and positively correlated distributions among relevant data, suggesting the presence of outliers in the data. As a matter of fact, simple boxplots identified 8 outliers for the general security risk metric (Crime Severity Index) and the pandemic risk metric (COVID-19 Index), by plotting them above their upper whiskers. This validated the Client’s concern about the potential presence of high-risk outlier neighbourhoods.
The additional clustering analysis with DBSCAN algorithm also identified the same 8 datapoints in two clusters remote from the concentration of the other data points. Simply put, the machine learning analysis only confirmed the earlier automatic identification of outliers made by the boxplot. As result, it was imperative to remove these outliers from the analysis.
Simply put, the boxplot has the whisker, its built-in criteria to automatically distinguish outliers from the rest. In contrast, the clustering model, although identified these 8 outliers as two remote clusters, did not provide a means to automatically determine them as outliers: although potentially some conditions might be added to enable it automatically identify the outliers.
So, the lesson from the first objective was that a sophisticated method is not necessarily superior to a simple method. We should take this lesson in modesty. Lesson from the second objective
After removing the outlier neighbourhoods, I performed Hierarchical Clustering Model and generated its dendrogram on the dataset of the non-outlier neighbourhoods. For the size of 40 non-outlier neighbourhoods, Hierarchical Clustering model worked very efficiently. And the dendrogram arranged neighbourhoods accordingly to the pairwise distance hierarchy and made it easy for me to shape human insight to decide how to cluster the subject. This presents a case that a machine learning model can play a great role in supporting human decision-making process. A user can leverage his/her profound domain expertise in the use of Hierarchical Clustering Dendrogram to effectively achieve the given objective. By interacting with a machine learning model in an organic way, the user can optimise the use of machine learning and make a better decision.
The Client can use their insight to discover their desirable clustering result based on the dendrogram and their human insight. Lesson from the third objective
I performed two hyperparameter tuning methods to discover the best n_clusters, the number of clusters, for K-Mean Clustering model. Unfortunately, neither of them yielded a convincing implication about the underlying cluster structure. This suggests that a clustering model would unlikely yield a reliable result for the given dataset.
The output of the machine learning is as good as the data input. The disappointing hyperparameter tuning result might have something to do with earlier concern about the data quality. The Foursquare might not have a coherent quality of data across different neighbourhoods sufficient to be a representative of their general profiles for this particular city.
Or, possibly the Foursquare sample responses could be a good representation of the overall profile of the city (only about the Non-Outlier Neighbourhoods). Moreover, there could be actually no particular underlying cluster structure among the neighbourhoods in the autonomous city of Buenos Aires.
Which is correct? This question requires a comparative study with data from other sources and would be a good topic for the prospective research, but beyond the scope of this project.
Whatever real reason it might be, all I know from these tuning results is that there is no convincing implication regarding the underlying cluster structure in the given data. In order to avoid an unreliable and misleading inference, I would rather refrain from performing K-Means Clustering Model for the given dataset. And I would rather prepare summary materials so that the Client can use their human insight/domain expertise to explore them and identify the popular venue profiles of neighbourhoods.
Part II: Suggestions for Future Development
Unfortunately, for the second part of the third objective—to segment non-outlier neighbourhoods into clusters based on the popular venue profile—I could not derive any convincing inference regarding the underlying cluster structure among non-outlier neighbourhoods. For the future potential improvement, I would suggest that the Client might want to explore other sources than Foursquare to examine the popular venue profiles of these neighbourhoods. That would allow the Client to assess by comparison if the Foursquare data is representative of the actual state of popular venues in the particular city.
In addition, as a suggestion, the Client might benefit from conducting a similar analysis based on per-capita data. In this project the risk metrics were scaled by population-density. A per-capita base scaling might yield a different picture about the risk profile of the neighbourhoods. As a note, population demonstrated a higher correlation with the risk metrics than population density did.
At last, for the prospective development, I would recommend that the Client should incorporate the following two lessons from this project into their analytical project management policy building.
When a basic tool can achieve the intended objective, it would be cost-effective to embrace the basic tool to derive a conclusion/inference, rather than blindly implement an advanced tool, such as machine learning. Here, by basic tools, I am contemplating basic visualizations and basic exploratory statistics, such as correlation and regressions.
When the given data is not suitable for the design of a machine learning model, it might be unproductive to run it. If that is the case, there would be no point in wasting the precious resource to end up yielding a potentially misleading result.
Due to the hype for Machine Learning among the public, some clients demonstrate some blind craving for it, assuming that such an advanced method would yield a superior result than basic tools. Nevertheless, this project yielded a mixed set of answers of both ‘yes’ and ‘no’. Especially since the Client demonstrated an exceptional enthusiasm towards Machine Learning for their future business decision making, I believe that it would be worthwhile reflecting these lessons for their future productive conduct of data analysis.
D. Final Product
Now, I would like to present the following summary materials that the Client can utilize for their ultimate decision-making: a map, two scatter plots, and a summary table.
Choropleth Map
In order to summarize the results for all these objectives, I added a pop-up feature to the choropleth map that I had created for the presentation of the objective 1 and 2 in order to display the following information of ‘Non-Outlier Neighbourhoods’.
Name of the Neighbourhood
Cluster Risk Grade, ‘Centroid_Grade’, to show the cluster risk profile of the neighbourhood.
Top 3 Venue Categories
The map above displays an example of the pop-up feature.
For high risk ‘Outlier Neighbourhoods’, I controlled the pop-up feature, since the Client wants to exclude them from consideration.
This map would compensate for the absence of the “venue category” base segmentation, allowing the Client to explore the popular venue profile for each neighbourhood individually.
The following two scatter plots display the underlying cluster risk structure in the two-risk-metrics space.
Although the first one with the names of neighbourhoods can be very helpful in identifying individual outliers, the densely plotted names at the left bottom are hiding the individual pots for ‘Non-Outlier Neighbourhoods’.
The second scatter plot without the name is useful to make an overview of the entire cluster structure.
In addition, as a summary table, I also present a table of the top 5 most popular venue categories, sorted by the cluster’s risk profile (in ascending order of Centroid_Grade) and the number of Foursquare venue response (in descending order of Venue Response. In this sorted order, the Client can view the list of neighbourhoods in an organized order: from the safest cluster to more dangerous clusters; from presumably the most popular venue neighbourhood to the less).
Since the table is very long, here I present only the top 7 rows of the list.
That's all for this blog.
Thanks for reading.
Donation: Please feel free to click the bottom below to donate and support the activities of www.reversalpoint.com