# Could I add a one hot encoding to each feature representing “has data” versus “has no data”

I have a data set that has some holes in it. I was wondering if I could add two columns for each feature representing this feature has data and this feature doesn't have data for each of my features. Would a CNN be able to take advantage of this or should I just use another method to approximate the result.

Note The reason why I'm looking for an alternative is that I have a very small dataset and I assume extrapolating would insert to great of a bias on whatever method I use determine the missing value.

Sample Data

0.0,0.3,0.2
0.4,Nan,0.2
0.2,0.6,Nan
Nan,0.1,0.5
0.0,0.2,0.0
0.9,Nan,Nan


Would be converted to

0.0,1,0, 0.3,1,0, 0.2,1,0
0.4,1,0, 0.0,0,1, 0.2,1,0
0.2,1,0, 0.6,1,0, 0.0,0,1
0.0,0,1, 0.1,1,0, 0.5,1,0
0.0,1,0, 0.2,1,0, 0.0,1,0
0.9,1,0, 0.0,0,1, 0.0,0,1


Since my dataset is already relatively small I don't particularly want to remove entries. This would reduce my data by roughly a third.

If this is a 'foul ball out of left field' (makes no sense and would cause more errors) how would you deal with a small data set with a decent amount of holes.

EDIT: As per @zachdj suggestion in comments

Would be instead converted to this data set which is much smaller.

0.0,1, 0.3,1, 0.2,1
0.4,1, 0.0,0, 0.2,1
0.2,1, 0.6,1, 0.0,0
0.0,0, 0.1,1, 0.5,1
0.0,1, 0.2,1, 0.0,1
0.9,1, 0.0,0, 0.0,0

• Can you give some background info what the data is about and for what reasons data might be missing? – Sammy Nov 18 at 21:02
• You don't need to one-hot encode the "missing" indicator. It's already binary. For example, your first row could be converted to 0.0,1, 0.3,1, 0.2,1, and your last row would be 0.9,1, 0.0,0, 0.0,0 – zachdj Nov 18 at 21:06
• The missing data is due to a mixture of non inputted user input and Not Applicable. Majority of the holes would be categorized as non inputted user input. The data types I'm looking to deal with are all numerical (price, size, percentage,..). All my missing categorical data have been encoded as all zeros. – Mandelbrotter Nov 18 at 21:09
• Thanks @zachdj that reduces the size greatly. – Mandelbrotter Nov 18 at 21:09
• I don't know much about neural networks, but if you're using such non-linear models, wouldn't it be safer to choose a value other than 0.0 when there is no value? i.e. something clearly out of the range of possible values. Based on this, the model could interpret it to be a particular case; then you would not even need the binary "this feature has no data" column, this would be implicit. – Romain Reboulleau Nov 18 at 22:02