I am starting to play around in datamining / machine learning and I am stuck on a problem that's probably easy.
So I have a report that lists the url and the number of visits a person did. So a combination of ip and url result in an amount of visits.
Now I want to run the k-means clustering algorithm on this so I thought I could approach it like this:
This is my data:
url ip visits abc.be 123 5 abc.be/a 123 2 abc.be/b 123 2 abc.be/b 321 4
And I would turn in into a feature vector/matrix like so:
abc.be abc.be/a abc.be/b impressions 1 0 0 5 0 1 0 2 0 0 1 2 0 0 1 4
But I am stuck on how to transform my data set to a feature matrix. Any help would be appreciated.