4
$\begingroup$

I've got a dataset of demographic details of store customers and which store they (most frequently) visit. I would like to categorize the stores based on their customers.

To clarify: The issue here is to create clusters of shops, on the basis of the characteristics of the customers who have attended them. In other words, the aim is to create clusters of shops having a similar clientele.

I have around 7,000 customer records, distributed (unevenly) across about 50 stores. Most of the customer data is categorical, but there are a couple of continuous variables. How should I go about categorizing the different stores?

$\endgroup$
6
  • 1
    $\begingroup$ I don't understand your reluctance to characterize each store (in part) by its mean on the continuous variables. What else would you try to do with those variables in a cluster analysis? As far as the categorical vars. go, it's possible that, even without much variation in modes, the variation that does exist would help form clusters of some distinctness. But if you don't believe this is true, it would seem you are arguing against the utility of cluster analysis in your situation, in which case who are we to talk you out of that position? $\endgroup$
    – rolando2
    Commented Aug 23, 2011 at 2:20
  • $\begingroup$ @rolando2 Thanks for the thoughtful response. I guess I thought that there might be a more sophisticated method for clustering continuous data based on the distribution of the variables, but perhaps not. More generally however I was concerned about the categorical variables - I suppose there are methods for dealing with them, however. $\endgroup$
    – fmark
    Commented Aug 23, 2011 at 3:08
  • $\begingroup$ It is still not clear to me what your goal of analysis is. Clustering is about analysis when you don't know the labels of (latent) groups. If you know the stores that your customers visited, this is a classification problem, not a clustering problem, and you can entertain a variety of classification methods, such as classification trees, say: they are easy to visualize and explain to other people. $\endgroup$
    – StasK
    Commented Aug 23, 2011 at 4:49
  • $\begingroup$ @Stask: If I understand correctly, the issue here is to create clusters of shops, on the basis of the characteristics of the customers who have attended them. In other words, the aim would be to create clusters of shops having a similar clientele. $\endgroup$
    – user5644
    Commented Aug 23, 2011 at 7:05
  • $\begingroup$ @lejohn: I don't think we should be guessing. The author has to clarify this. $\endgroup$
    – StasK
    Commented Aug 23, 2011 at 14:36

3 Answers 3

1
$\begingroup$

You have to aggregate the data at the levels of the 50 stores. Then you can apply your cluster algorithm on these aggregated data.

Regarding the categorical variables, I would not use the modes. I would recode all the categorical variables into binary 0/1 variables, and compute the means. If you have a variable equal to 1 if a customer is a men and equal to 0 otherwise, the mean gives you the proportion of men who have visited a particular shop. You have to set up your data as follows. If a categorical variable has two categories, it has to be recoded into a 0/1 variable. If a categorical variable has more than two categories, you have to create a binary (0/1) variable for each category of the original variable.

$\endgroup$
1
  • $\begingroup$ Thanks for clarifying this, I wasn't sure if there was some nifty technique for clustering without aggregation. $\endgroup$
    – fmark
    Commented Aug 24, 2011 at 3:32
1
$\begingroup$

I would greatly consider looking into Latent Dirichlet Allocation. It's not a clustering algorithm, but rather a topic model -- individual stores would be modeled as mixes of underlying themes. Different types of customers would have varying likelihoods based on particular themes. It is a fully generative, Bayesian model, so you get some very detailed information about the themes in each store, and the customer properties associated with themes.

There is a free C version of it that you can use; otherwise, a Gibbs Sampling package like BUGS can fit the model using a fairly straightforward of the Bayesian network underlying the model.

$\endgroup$
0
$\begingroup$

I'm doing something similar and my process is described. Using PCA could be helpful. This will give you the most significant variables from the demographics that are present. Using K-means, pam, clara etc, cluster the stores using the significant variables.

Hope This Helps

$\endgroup$

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.