# Analysising the difference between k-means and spectral clustering algorithm

My target is to cluster the spatial area based on the location(X,Y) and pollutant concentration(Z). So there would be three different attributes along the spatial area(n_sample = grid point)

I have tried two method: K-means & Spectral. But the results are so different.

Here is my figure.

My research area is not in square shape but in the interior of administrative division. Due to the difference between two methods, I presented my doubt here:

• Which method fit my target(spatial clustering by three attributes which are the geographical location and the concentration there)best?(Any method beside these two are OK)

• Directing to the best method, what parameters setting is recommended?

## 2 Answers

It's really a difference between similarity (cosine, or correlation) and dissimilarity (Euclidean distance) coefficients. The spectral will assign cluster colors next to one another which are closer in terms of distance. The K-means looks like its assigning cluster colors based on correlation between regions over the three feature values. Spectral reveals similar levels of features values while the K-means reveals clusters with the same correlation (not level of feature values).

You have a quite fundamental problem here, and both are probably failing.

You are putting three different variables into one data set: latitude, longitude and pollution. Don't do this. They are not the same, so don't treat them the same way. In particular, don't do this when location was sampled on a grid, and pollution was measured. Also, they have very different scale and importance for your probldm (you likely are more interested in pollution than in clustering locations).

What you need is a much more complex algorithm (you will probably not find it in your standard toolbox, and I cannot give you a recommendation). It needs to only cluster pollution (your measurements) and consider the sampling location as a constraint. For example, you may require cluster members to be connected.

• What about considering the pollution level as a density (up to some multiplicative constant...)? A kernel method would produce a smooth function. Its contour lines at well chosen levels (e.g. levels corresponding to regularly spaced quantiles) would delimit natural regions. – Elvis Jun 12 '16 at 10:24
• @Elvis that would probably be prone to boundary effects. But you can of course try to use contours based on the pollution alone. But that may produce some outliers. – Anony-Mousse Jun 12 '16 at 10:27