# How to refine K-means clustering on a data set?

I'm working with a data set where the data is stored in a string such as AxByCyA where A, B and C are actions and v,w,x,y,z are times between the actions (each letter represents an interval of time). It's worth noting that B cannot occur without A, and C cannot occur without B, and C is the action I'm attempting to study (ie: I'd like to be able to predict whether a user will do C based on their prior actions).

I intend to create 2 clusters: people who do C and those who don't.

From this data set I build a training array to run the sci-kit (python) k-means algorithm on, containing the number of As, the number of Bs, the mean time between actions (calculated using the average of each interval) and the standard deviation between each interval.

This gives me an overall success rate of 82% on the test set, but is there anything I can do for more accuracy?

• How many clusters are you using, and which meaning you give to them? – pasaba por aqui May 9 '18 at 9:32
• @pasabaporaqui ah I'll add that to my post... 2 clusters, people who do C and those who do not – Jessica Chambers May 9 '18 at 9:35
• First hint could be increase number of clusters, labeling them "C" or "not C". – pasaba por aqui May 9 '18 at 9:36
• Which distance measure do you use in the classifier, and which one i the learning ? euclidean ? – pasaba por aqui May 9 '18 at 9:37
• @pasabaporaqui I think it uses the euclidean distances, yeah... and adding more clusters did improve the result; how many clusters are too many? – Jessica Chambers May 9 '18 at 9:41