6
$\begingroup$

I'm facing an issue where I have a massive amount of data that I need to cluster. As we know, clustering algorithms can have a very high O complexity, and I'm looking for ways to reduce the time my algorithm is running.

I want to try a few different approaches, like pre-clustering (canopy clustering) or subspace clustering, correlation clustering etc.

However, something that I haven't heard about, and I wonder why - Is it viable to simply get a representative sample from my dataset, run the clustering on that, and generalize this model to the whole dataset? Why/why not is this a viable approach? Thank you!

$\endgroup$
3
  • 1
    $\begingroup$ Have you considered mini-batch K-means? this version of the algo does not use all the data, but operate on a batch level. Here is a link for some docs scikit-learn.org/stable/modules/… $\endgroup$ – Yaroslaw Homenko Nov 9 '20 at 10:33
  • $\begingroup$ @YaroslawHomenko Yes, I am considering several methods including this one, was just wondering if sampling would work at all. $\endgroup$ – lte__ Nov 9 '20 at 13:10
  • 1
    $\begingroup$ mini-batch K-means is basically doing the random sampling, so your question is valid. $\endgroup$ – Yaroslaw Homenko Nov 10 '20 at 16:20
4
$\begingroup$

I would get a sufficiently large random/representative sample and cluster that.

To see what is such a sample, you will have to get two such samples and cluster them to get cluster solutions c1 and c2. If the matching clusters of c1 and c2 have the same model parameters, then you probably have representative samples.

You can match the clusters by looking at how c1 and c2 assign drawn data to clusters.

$\endgroup$
2
$\begingroup$

It's definitely viable, just that there is catch 22.

In order to get this representative sample from your dataset, you have to sample from every cluster. But if you already can sample from every cluster, you already know them, hence you don't need unsupervised learning.

$\endgroup$
4
  • $\begingroup$ Isn't a random uniform sample going to make sure the sample has the same properties as the original set, so it will roughly have the same clusters? $\endgroup$ – lte__ Nov 9 '20 at 13:09
  • $\begingroup$ depends on the number of samples pro cluster. $\endgroup$ – Noah Weber Nov 9 '20 at 13:49
  • $\begingroup$ @NoahWeber could you detail why it depends of the number of samples pro cluster please ? I see a potential issue using random uniform sampling with very small clusters vs ratio of sampling, but if clusters are relatively large, random uniform sampling should keep the same properties as the original set, shouldn't it ? $\endgroup$ – etiennedm Nov 10 '20 at 7:59
  • $\begingroup$ that is correct. $\endgroup$ – Noah Weber Nov 10 '20 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.