# Clustering elements by access counts in sessions

I have a set of sessions and urls that have been accessed in each of these sessions and frequencies with which they have been accessed. I've put them in a matrix-like representation.

Imagine I have the following "Pageview matrix":

COLUMN HEADINGS

books placement resources br aca


Each row represents a session.

Here is an example of the records:

4 5 0 2 2
1 2 1 7 3
1 3 6 1 6


saved in a .txt file

Can I give this as an input to a k-means program and obtain clusters based on the highest frequency of occurrence? How do I use it?

If not k-means, what other cluster method can I use?

-

So, taking your comment into consideration, you want to make clusters of entries which group those entries which were frequently co-accessed?

If so, well, you need to decide how to measure this co-access, i.e. transform it into a dissimilarity, and this is a fairly nontrivial task.
The simple measure is to count, for each pair of entries, sessions in which they both were accessed and divide by the count of session in which any of them was accessed. The resulting matrix will be similarity one, so you can for instance subtract each cell from one and feed the result to the clustering algorithm of your choice.

Of course this measure does not take the access counts during session into account, so you'll probably need something more complex; one idea (simple extension of the trivial one) may be to sum minimal smaller of counts from each session when particular pair co-occurs and divide the whole by the sum of total number of accesses to the both entries.
However, you should try to make this measure on your own taking into account the specificity of this particular problem.

-
oh yes,this helped :) –  abhiii5459 May 6 '11 at 10:40