# Dealing with NaN for predictive models

I have data set that has data for patients:

Arrival_Date : is when the patient has arrived

Seen_By_Nurse : is number of minutes patient take to be seen by nurse since arrival when value is NaN it means patient is still waiting and has not been seen by Nurse yet

Seen_By_Dr: is number of minutes patient take to be seen by dr since arrival when value is NaN it means patient is still waiting and has not been seen by Dr yet

Upset_Patient : Is this patient upset or not 1 or 0

The data look like this:

Arrival_Date   Seen_By_Nurse   Seen_By_Dr   ... many other fields ...   Upset_Patient
14/8/19 14:15  10              25                                       1
14/8/19 15:32  13              NaN                                      0
14/8/19 15:35  16              NaN                                      1
14/8/19 15:39  NaN             NaN                                      0
14/8/19 15:44  NaN             NaN                                      1


My question is: I know that working with NaN failing many predictive models. Therefore, I have to either fill it with other values, such as mean. Which is going to be wrong in my case. Or delete it which also going to be wrong in my case as the majority has not been seen by Dr or Nurse yet.

Should I fill it with big number such as 9999? Are there any other approaches?

What is the best way to deal with NaN in this case?

• What i do is check whether sum of all Nans in a column is more than 70% .Also we can substitute it with 'other' in case of categorical column, then do one hot encoding and ultimately drop it. You can also substitute with mean /mode and plot it against Target variable to see whether it influences Target or not. Sep 19, 2019 at 6:15
• @Shubh Cant replace it with other, it is numeric value Sep 19, 2019 at 6:36
• with numeric you can only substitute for mean. Sep 19, 2019 at 6:47
• @Shubh I have mentioned in my question that mean is not right thing to do in my case Sep 19, 2019 at 6:48
• When the value is missing, can you generate the amount of time so far? (Is there a "current time" that the data is a snapshot of, or a variable "observation time" per patient?) Sep 19, 2019 at 18:32