0
$\begingroup$

I am a bit new to this, but I just had a quick question about clustering vs. classification. I have a bunch of texts that I want to classify. There are 4 classes I have at the moment, but texts can belong to more than one class. What I have seen so far is to do 4 binary classifications, but I was wondering if there is a classification algorithm where I can achieve texts belonging to more than one class. Or could I do this with clustering having overlapping clusters?

I am trying to do this in Python.

$\endgroup$
1
$\begingroup$

Clustering is unsupervised which means that you do not know the classes and / or have no examples of correctly labeled texts.

Assuming you have some labeled texts then we are talking about a classification problem.

Your current approach of doing separate binary models for each label is very basic but still sound. What is your validation metric and score for each of the models? If the performance is already good then you might not need something else.

Another approach would be to train one model that predicts all classes and then to output the multiclass probability prediction. This would give you information about the best fitting classes but you would have to fit your loss metric accordingly, accuracy wouldn't make sense here for example.

Another approach would be to make a new factor variable which encodes all possible combinations of classes and train one model on this. However I suspect that the model would perform badly due to imbalanced cases and a high complexcity.

$\endgroup$
1
$\begingroup$

The problem you are working on is Supervised Learning as you already know the labels for each samples. If you try to Cluster the dataset which is Unsupervised Learning, you may not expect the texts to be clustered in a way you want it to be. Because the clustering is done based on the pattern (similarity) rather than the output labels.

In order to solve the above problem you can go for Multi-Label Classification where each samples can have more than 1 classes.

$\endgroup$
2
  • $\begingroup$ But I don't know the labels, that's why I was considering clustering. I have also explored using Snorkel to label. $\endgroup$ – formicaman Jul 16 '20 at 12:20
  • $\begingroup$ If you do not know the labels it is better to go with Clustering techniques. However in this case one sample can associated with only one cluster, it cant be a part of multiple clusters. Also number of clusters may vary based on the metric you consider. $\endgroup$ – deepguy Jul 16 '20 at 12:25

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.