# How to handle unseen class feature in test dataset

feature   Definition    Key
survival    Survival    0 = No, 1 = Yes
pclass   Ticket class   1 = 1st, 2 = 2nd, 3 = 3rd
sex       Sex           M/F
Age     Age in years


feature notes given below

pclass: A proxy for socio-economic status (SES)
1st = Upper
2nd = Middle
3rd = Lower

age: Age is fractional if less than 1. If the age is estimated, is it in the form of xx.5


Suppose I have dataset same as mentioned above.

How to handle a case where I can have a unseen value for a class. For example : In our dataset we have 3 different value for pclass. But how to handle a case where pclass value may have 4rth class say "elite" which did not appear in training dataset but appeared in the test dataset

• I want to remind about a technique where you re-use a pre trained CNN to continue generalizing on another dataset. For example, you train on hand-written digits from MNIST, which has a ton of examples, and then apply it to your personal (much smaller) data-set of hand-written Greek characters. You can do this because they are sufficiently similar to the digits dataset. – Kari Mar 5 '18 at 23:34

Depends on the model. I would say most of the time the new level is dropped or mapped to a NA level. If possible, you should try to do a stratified sample for your training set to ensure that you get every level you care about.

I don't think having new class value would be a problem, unless you decide to convert the class values into features. If you don't want to run into errors, either drop the new feature in test phase, or ensure that it comes during training phase.