5
$\begingroup$

I have a data set with a set of users and a history of documents they have read, all the documents have metadata attributes (think topic, country, author) associated with them.

I want to cluster the users based on their reading history per one of the metadata attributes associated with the documents they have clicked on. This attribute has 7 possible categorical values and I want to prove a hypothesis that there is a pattern to the users' reading habits and they can be divided into seven clusters. In other words, that users will often read documents based on one of the 7 possible values in the particular metadata category.

Anyone have any advice on how to do this especially in R, like specific packages? I realize that the standard k-means algorithm won't work well in this case since the data is categorical and not numeric.

$\endgroup$

4 Answers 4

1
$\begingroup$

Sounds like you are set to do collaborative filtering - you have readers (users) and documents (items) creating a unary-response matrix with 1 cells indicating the reader (row) read the given document (col). There are various types of recommender systems (e.g., user-based and item-based collaborative filters) and several of them can account for the meta-data associated with your documents (e.g., content-based systems). You should look into R package {recommenderlab}

$\endgroup$
0
$\begingroup$

check out the homals package in R, it might be a good starting point for you in terms of reducing the dimensionality of your dataset.

$\endgroup$
0
$\begingroup$

Given that your data is categorical, one approach that might work is latent class clustering. There is a huge literature out there on this set of models and an R module that is fairly easy to run. See poLCA: An R Package for Polytomous Variable Latent Class Analysis by Linzer and Lewis published in the Journal of Statistical Software, June 2011, Volume 42, Issue 10.

LCMs are a subset of finite mixture models and were first developed in the 50s by Paul Lazarsfeld, a Columbia sociologist. They have seen extensive development since and are probably most widely used for segmentations by marketing scientists. If you have $1,000 to spend, you can purchase a perpetual license for Latent Gold from Statistical Innovations. In my opinion, LG is the single best tool for LCMs.

$\endgroup$
0
$\begingroup$

If you want stick to clustering, then you can calculate similarity matrix based on measure suitable for categorical data (hamming, jaccard...) and fetch it to hierarchical clustering algorithm.

I'd also suggest to look for association rules, there is very nice package in R ARules, which can show the frequent products. Moreover, it can also visualize the "products" used together, so you could see groups of similar products.

$\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.