Per this deep learning book I am reading:

In general, with neural networks, it’s safe to input missing values as 0, with the condition that 0 isn’t already a meaningful value. The network will learn from exposure to the data that the value 0 means missing data and will start ignoring the value.

However, let's say 0 is meaningful. What should I do instead? What if I give it like a large value like 10000?

  • 1
    $\begingroup$ I fail to understand how giving an arbitrary value to an unobserved event can be valid. There are plenty of papers on imputation of both predictors and responses, and this is not a trivial thing. It depends, among other things, whether missing data are due to censoring (e.g. below detection limit) or missing completely at random. No single value for all missing data can fix this problem, and many can make it worse. It may well be that neural networks are less sensitive, but I suspect that is because they are not as heavily scrutinised as statistical models. $\endgroup$ – Carsten Apr 3 at 12:02
  • $\begingroup$ Well the book is Deep Learning with Python by Francois Chollet. Good to know I need to give a bit more thought with coding missing data. I am trying to build either a boosting tree or neural network. I would imagine giving it an arbitrary large value should be ok for both models. Since trees split on thresholds, it could easily just filter out the missing values I would imagine. If x > 9999, do one thing, if x < 9999 do another thing. $\endgroup$ – confused Apr 3 at 12:04
  • $\begingroup$ In my particular case, missing data would be the situation where that feature did not occur and thus there was not quantitative value associated with it. I guess I could include another dummy saying if something was observed or not but I still have to deal with the missing values... $\endgroup$ – confused Apr 3 at 12:06
  • $\begingroup$ Well, I guess the point is that there is a reason why the feature did not occur. If so, you cannot assume it to be missing completely at random and simply omit it, as that would bias your analysis. Have a look at Nakagawa's nice chapter "Missing data: mechanisms, methods, and messages" in "Ecological Statistics". $\endgroup$ – Carsten Apr 3 at 12:14
  • 1
    $\begingroup$ The claim made in the book is a terrible practice; reading up on imputation will explain why. $\endgroup$ – Sycorax Apr 3 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.