0
$\begingroup$

I have geolocation data (lat and long) per customer per online purchase, and my end goal is to identify common locations per purchase per customer. (basically to see what people typically buy when they are at home, vs what they buy when at work etc)

As a start I wanted to group the latitude longitude pairs per customer into a 'home' set, a 'work' set etc, and then I can link the purchases to each area set.

So to cluster the data pairs (and ultimately define my 'sets'), I had initially thought k-means clustering would help, but I have a different amount of geolocation data per general area per customer. (what I mean is, for one customer I have (LATITUDE,LONGITUDE) = (-25.756124, 28.23253) call this 'Location A' and 3 other pairs near that 'Location A', and then at 'Location B' I will have 50 pairs around 'Location B'. This is what makes me think that k means clustering might not be best)

Can someone please send me on the right track?

$\endgroup$
1
  • $\begingroup$ Can you please put up some data samples, cause what you are trying to ask, is quite unclear. $\endgroup$
    – Dawny33
    Commented Aug 27, 2015 at 11:25

1 Answer 1

0
$\begingroup$

k-means is based on computing the mean, and minimizing squared errors.

In latitude, longitude this does not make much sense: the mean of -179 and +179 degree is 0, but the center should be at ±180 deg.

Similar, a difference of x^2 degrees isn't the same everywhere.

You should be using other algorithms, that can work with haversine distance.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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