Home > Software design >  Can Tensorflow Machine Learning Model train data that has None values?
Can Tensorflow Machine Learning Model train data that has None values?

Time:11-29

I'm wondering if Tensorflow Machine Learning Model can train data that has None valuess? I have a Data table with multiple data (in each row) and in some of these rows, there are columns with None/Null value:

Column A Column B Column C
50 None 2
2 100 None

Or should I not have None values in my dataset and instead set all of them to 0? But then I think 0 is not a really good representation of the value because the reason why there are None values is simply because I couldn't get data for them. But 0 kind of means like a value...

CodePudding user response:

TensorFlow is no different to any other ML solution you could find - strickly speaking, no, it cannot lear from Nones and its your responsibility to encode them somehow to a numerical value. It could be any value you find reasonable - I would recommend you to read through https://scikit-learn.org/stable/modules/impute.html, for example.

CodePudding user response:

You are trying to avoid Imputation. Most models don't support this, but some implementations of "Naive Bayes" and "k-Nearest Neighbor" can do it apparently. Maybe this article can help you.

  • Related