Often we are required to quickly locate distinct and well separated groups in our data, for example, grouping customers who have the same buying patterns, or patients with similar symptoms, and so on. More often than not, this can be done using the grouping functionality that we saw in previous chapters.
However, this can be challenging, as finding patterns via manual inspection for complex and distributed datasets with no obvious patterns can be very tough.
The new clustering functionality in Tableau automatically groups together similar data points by finds patterns in data using a K-means algorithm to help the user explore patterns in the data that would be tough to pick out otherwise.
Let us explore the clustering functionality in more detail in the recipe.
We will use a new dataset for the following recipe. The dataset is a .tde
, file which has been uploaded on the following link:
https://1drv.ms/u/s!Av5QCoyLTBpnhks3n2mxItiI7-tb.
The file is called World Indicators.tde
. We will download this extract file and save it to the Tableau Cookbook data
folder in Documents | My Tableau Repository | Datasources. We will continue working in our existing Tableau workbook.
Let's get started.
Clustering
..tde
file from Documents
| My Tableau Repository
| Datasources
| Tableau Cookbook data
folder. Refer to the following screenshot:If we now take a look at the bar chart we created earlier, we will see the light blue color, which represents Cluster 4 and indicates that Internet usage is very high; the red color, which represents Cluster 3, indicates that Internet usage is high; the orange color, which represents Cluster 2, indicates Internet usage is moderate; the dark blue color, which represents Cluster 1, indicates that Internet usage is low; and the green color, which represents Not Clustered, indicates a complete lack of any Internet usage data.
As mentioned earlier, Tableau uses the K-means clustering algorithm; to understand this in a little more detail, we can right-click on the Clusters field, which is currently placed in the Color shelf, and select Describe clusters…. Refer to the following screenshot:
We will now get the following view:
To learn more about clustering in Tableau, refer to the following link:
https://onlinehelp.tableau.com/current/pro/desktop/en-us/clustering.html