1
$\begingroup$

I have some continuous data, and want to do kmeans clustering with this. But weirdly when I did kmean clustering with this data, the outcome was very conflicted with my presumption. So I decided to do same thing with ordinal categorial data, but I was reluctant to converting continuous form into discrete form, because as I know it loses information and characteristics of data to a certain degree.

So, I devided data by 100 classes, 1 class for 1 percentile of whole data. But since I coded names of class as 1, 2, 3...from minimum to maximum, I can say it still has 'volume' or 'value'. For example, the class covers 99~100 percentile of whole data is named '100', which is the ordinal category that contains the biggest value. And the result based on this were exactly same as I intended.

But here is my dilema. People say don't do kmeans with discrete data. And with the original form of mine, coninuous form, I don't get good result, but with discrete form, I do. Kmodes, used for discretized data was already turned out to be effectless in my case. That is why I am trying to do like this. I think my method is quite plausible because I devided class by percentile, not the uniform interval. Plus, since the number of class is 100, it is thought to preserve the information of data quite well compare to typical binarization consists less than 10 or something like that.

So if someone asks me 'why did you use discrete data with the algorithm don't recommended with it?', can I insist my data is discretized but it is still has characteristics of continuous data to certain degree?

$\endgroup$
2
  • $\begingroup$ Can you explain what do you mean by "with the original form of mine, continuous form, I don't get good result, but with discrete form, I do"? $\endgroup$
    – dipetkov
    Commented Oct 2, 2022 at 16:25
  • $\begingroup$ You've done the categorizarion into percentile groups aka equal-size group binning. Now, this transformation brought a meaning to the codes 1, 2, 3... 1 means "n smallest observations", 2 means "next n bigger observations than 1", 3 means "next n bigger observations than 2". Clearly, this can be considered an interval (rather than an ordinal) scale, having interval n. But that is not the original metric of the input variable. Still, since the binned data are interval, you could do K-means on it, bearing in mind that the results should be interpreted differently from K-means on original data. $\endgroup$
    – ttnphns
    Commented Oct 7, 2022 at 10:37

1 Answer 1

0
$\begingroup$

It is often OK to quantize your data as long as it doesn't lose "too much" information. So in principle, you are right here.

But in your example, it sounds like quantization does lose a lot of information since your results change drastically.

So I would try to figure out, why your results change that much through quantization. First, ensure that your results from k-means are robust and don't just depend on random initialization. Then, you might want to gradually change the degree of quantization to see when your results change; this might give you a clue as to what is going on. Finally, try other clustering algorithms, like e.g. DBSCAN, to see whether your observations are dependent on the algorithm you are using.

$\endgroup$
1
  • $\begingroup$ THank you! It helped a lot $\endgroup$
    – hogu
    Commented Oct 5, 2022 at 4:31

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.