machine-learning

How to deal with label that not included in training set when doing prediction


For example, using supervise learning to classify 5 different people face. But when test on 6th people face that not in training set, the model will still predict it within the 5 people. How to let the model predict the 6th and onwards people face as unknown when the model doesn't train them before?


Solution

  • You could set a certain threshold for prediction the known classes. Your model should predict from the known classes only if it predicts it with a certain threshold value, otherwise, it will be classified as unknown.

    The other (and less preferable) way to deal with this problem is to have another class called unknown even during training and put some random faces as corresponding examples of this class.