Oct 16, 2020 · In this example we want to cluster the MALL_CUSTOMERS data from the previous blog post with the very popular K-Means clustering algorithm. The standard Euclidian distance is good enough for this case, but SAP HANA would also allow for further distance metrics such as Manhattan distance, Minkowski distance, Chebyshev distance or Cosine distance ... K-medians is a variation of k-means, which uses the median to determine the centroid of each cluster, instead of the mean. The median is computed in each dimension (for each variable) with a Manhattan distance formula (think of walking or city-block distance, where you have to follow sidewalk paths).