Impute missing values in Tensorflow?

Viewed 6306

I know about sklearn.preprocessing.Imputer but does Tensorflow have built-in functions to do this as well?

2 Answers

As far as I know, there isn't a handy function that does the same thing as sklearn.preprocessing.Imputer.

There are a few ways of dealing with missing values using built-in functions:

  1. While reading in data: For example, you can set the default value for a missing value when reading in a CSV using the record_defaults field.
  2. If you have the data already: You can replace the nans using tf.where (example)
Related