1
$\begingroup$

Please bear with me because I am very new to data mining.

I have a database of 3 attributes: latitude, longitude and temperature. I want to find clusters for the temperature data and I also want to include the effect of latitude and longitude in that so that temperature is not the only determining factor for the clusters.

If I, let's say, build K-means clusters using all these attributes (in WEKA for example), what do the resulting clusters tell me? Can I get any interpretation of how latitude and longitude information is related to clusters of temperature? What is the correct way to go here?

$\endgroup$
  • $\begingroup$ Are you looking to control for latitudinal effects by detrending for instance (i.e. estimating the latitudinal temperature trend, then removing it from the data before identifying clusters)? $\endgroup$ – MannyG Oct 18 '12 at 1:09
3
$\begingroup$

K-means attempts to group observations by spatial proximity. If you were to specify 2 clusters (k=2), for example, you might find that there were two groups of clusters that were (hopefully) spaced far apart. In that case, you might find then that values of low latitude and low longitude might be clustered in the same group as values with low temperature. Conversely, the other cluster may show high latitude and high longitude observations tend to fall in the same space as high temperature. In this example, you might infer that it found some measure of association between the attributes based upon proximity features. Note, that a lot of the analysis is greatly augmented by visualizing the results (which is easy to do in 3 dimensions). Because the clusters may not be well separated, even though you force 2 or more clusters. There's also no guarantee (at least that I know of) that you will assign the correct number of clusters (for your problem) to begin with; another reason to look at the results.

If you were to only look at temperature clusters, you might find that there was a tendency to measure distinctly different groups of temperatures that were not randomly distributed .. but again, much of that meaning could also be investigated just be looking at the data itself, or using other statistical measures (Fisher Linear Discriminant, for example).

I generated a simulation (via R) to show an illustration of the above example. I started by generating synthetic data with low values for lat,long,temp and high values for the same set. Then I just concatenated the low and high values together and made a dataframe object (matrix) of the 3 attributes. K-means with k=2 was able to find very good separation between the groups without prior knowledge of their associations (as can be seen in the summary, where it grouped all of the 1st half in one set and 2nd half in the other, as we would expect). Notice the summary results also show good separation between groups it found (99.4%).

temperature-kmeans

$\endgroup$
5
$\begingroup$

There are a number of aspects here that can mess up your analysis.

First of all, I don't think Weka has support for great circle distance. So to all the Weka algorithms, Hawaii and Australia are further away from each other than Australia and Florida.

Secondly, you have a problem of scale here. If you naively throw the data into k-means - which is designed for Euclidean distance - then you are assuming that 1 degree in latitude is the same as 1 degree in longitude and the same as 1 unit of whatever temperature scale (F or C?) you are using. But is that really sensible?

As an ad-hoc approach to remedy the latter, you can try to apply z normalization onto your data set. The key point is that it normalizes each axis by the standard deviation of your data set. That gives somewhat equal weight to the different attributes (which, however, doesn't say they should have equal weight or are equally helpful ...)

Note that there are a lot of specialized algorithms for the geographic domain. In particular for lat+long+1 data variable, there are tons of algorithms. They are sometimes designed by actual geographers for a particular problem, and some can integrate physical knowledge about how e.g. temperature transfer or radioactive decay is expected to work.

$\endgroup$
1
$\begingroup$

The previous answers have pointed out good aspects :-) My post has the focus on the used data mining software because you mentioned WEKA and that you wanna achieve interpretations. Use RapidMiner which avoids headache. RapidMiner is stable in contrast to WEKA. RapidMiner achieves better results and the visualization of RapidMiner is really great - different plot views are available (scatter, bubble (with include options for bubble size and bubble color related to additional attributes), 3D plots, parallel, ......). Within the plots you can display the relations between attributes and you clearly see a result better than observing centroid tables or WEKA text output. (WEKA plots are subpar) Comparing kMeans algorithm with EM algorithm helps to achieve different insights regarding the count of clusters when using the same data set. R is really great, but it needs some learning (and time) effort at the begin. I have stopped using WEKA because it created too much headache - Connect to a DB with WEKA is another buggy part (WEKA 3.6.2 - new version of WEKA does not start at all). btw RapidMiner contains many cool features (even ReadBibTeX, but that's another tale).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.