Is it possible for an algorithm to predict a new class that has never been before in training? For example, in my training data I have:

I need a flight to Boston --> flight query

What is two plus two --> math query

Who is the president of the United States --> Donald Trump

How can I make a model that can predict a new class for:

How are you today --> ??? (Should be something like conversation query)

I am almost looking for a way to combine supervised learning and unsupervised learning. Using supervised learning for a model to predict new classes (unsupervised learning)

  • $\begingroup$ Do you plan on providing a set of possible classes? $\endgroup$ Jan 6, 2017 at 10:31
  • $\begingroup$ This might be a x y problem. Are you really interested in a generic open-ended classifier as your model (and if so, how are you expecting the computer to correctly label a new class, as opposed to simply identifying that it is a class it has not seen before and assign some kind of generic id), or are you trying to solve a different problem in NLP such as creating a Topic Model? $\endgroup$ Feb 6, 2017 at 14:41

2 Answers 2


Do you mean a class label that the algorithm has never seen before? Then no, it is not possible. If you dont have labelled data for all your samples you can run a LDA, to get some topics and then assign labels based on the topics obtained. Even this approach wouldnt be really great. Since your problem is classification, I would recommend restricting your domain and using only samples for which the label is known. For better classification accuracy you can look into CNN.

  • $\begingroup$ Yeah, just suggested in case a BOW model doesn't work well. Have been working with them and found them useful so I suggested. $\endgroup$ Feb 6, 2017 at 15:32
  • $\begingroup$ Did you mean to say "RNN"? I don't see how a CNN would replace bag-of-words. $\endgroup$ Feb 6, 2017 at 15:33
  • 1
    $\begingroup$ I meant CNNs only. Check out Denny Britz's blog on text classification using CNNs. They work surprisingly well. $\endgroup$ Feb 6, 2017 at 15:39
  • $\begingroup$ OK, thanks, I learned something new from that. I don't think it's been as well publicised as use of RNNs/LSTM. I've taken the liberty of editing in an explanatory link. $\endgroup$ Feb 6, 2017 at 15:41

Identifying new classes sounds like unsupervised learning to me, not supervised learning. Supervised learning implies a fixed set of labels (and appropriate training data) that you as a human provide, which is how you teach the machine.

Teaching the machine to identify new classes is a different matter altogether, you're essentially asking the machine to intelligently identify something it has no knowledge of, because no designated training data (=knowledge) exists in the model. This is, as far as I know, not possible.


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.