1
$\begingroup$

If you are asked to do text categorization using clustering. Which algorithm would you use and why?

$\endgroup$

closed as too broad by Anony-Mousse, Dawny33, Neil Slater, Sean Owen Nov 27 '15 at 13:52

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    $\begingroup$ Almost any algorithm will do the trick. On the other hand it is worth spending some thought on what features of the texts you want to use as a base for the clustering. This depends very much on your research question. $\endgroup$ – jknappen Nov 25 '15 at 15:43
1
$\begingroup$

It will depend on the purpose and the text. Many options this is what I have used.

k-means clustering with TF-IDF

What I did was limit the cluster and any document vector to the top 1000 terms sorted by weight. This not only results in faster processing but you get some multi modal clusters and will have thousands and thousands of terms. What happens is those really long vectors dilute the similarity when compared to a even a long single document. I think you also get faster convergence. If you want to keep documents out of multi modal clusters then don't truncate the cluster vector.

$\endgroup$
  • $\begingroup$ What's K9? You linked to k-means. $\endgroup$ – Emre Nov 25 '15 at 18:06
1
$\begingroup$

Text categorization using clustering can be done in a lot of ways. Some of which are:

In fact, most(or almost all) the clustering algorithms can be applied for classifying text through clustering.

$\endgroup$
  • $\begingroup$ k-means is not the knn algorithm (and not a good choice) $\endgroup$ – Anony-Mousse Nov 25 '15 at 23:12
  • $\begingroup$ @Anony-Mousse Thank you for spotting the spelling error. Rectified. As the OP asked about any algorithm, I included k-means which I have used once, and is a relevant answer. $\endgroup$ – Dawny33 Nov 26 '15 at 2:22
1
$\begingroup$

tf-idf vectors are an easy start, but it can be hard to cluster very high dimensional data.

You might try topic modeling (LDA, LSI for example) to reduce the dimensionality of your features.

A newer approach is paragraph vectors, which learn a distributed representation of arbitrary-length text. Here is an implementation in python.

Learning a reasonable, lower dimensional representation of the text can help with the issues that arise trying to cluster high dimensional data.

$\endgroup$
  • $\begingroup$ The link on paragraph vectors doesn't work. $\endgroup$ – SmallChess Nov 26 '15 at 2:53

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