Which of the following is a better approach in dealing with null values and why?

  1. Fill the null values with the mode (most occurring value).
  2. Consider the null itself as a category by converting it to a string.
  3. Remove the records with the null value.
  4. Predict it using another non-null columns.

Edit P.S: I am work with the following dataset https://data.ontario.ca/dataset/confirmed-positive-cases-of-covid-19-in-ontario

It is about the covid-19 cases in Ontario. In this dataset a string categorical column named "Case_AcquisitionInfo". It has some values with string "MISSING INFORMATION" so should I consider this null or consider this as a category.

  • 2
    $\begingroup$ I feel removing the null records might be helpful. Filling the null values with the most frequent observation might result in outliers. You can consider Null as a category if the feature permits it. Like for a variable isSick, you can have two values Yes or No. A value of Null could make no sense. $\endgroup$ – Shubham Panchal Apr 10 at 7:30
  • $\begingroup$ More information about your problem might be helpful. In example, how many categories do you have? what is the ratio of the null records in the data? $\endgroup$ – Amit Keinan Apr 10 at 9:42
  • $\begingroup$ Assume the ratio is very low, say <1% of total data, then should I delete those records, or fill with mode. Anyways for large ratios I prefer to drop the column itself. $\endgroup$ – Yogesh Apr 10 at 12:46
  • $\begingroup$ You can simply try both, and inspect results to determine what method to use in final model. $\endgroup$ – tkarahan Apr 10 at 14:47

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.