Search code examples
artificial-intelligenceneural-networkpybrain

PyBrain: passing empty floats or switching them with neutral values?


Right now, I am trying to pass this for a dataset sample:

7/2/2014,7:30,138.885,138.87,138.923,,,,138.88067,138.91434,138.895,,,,138.89657 14,138.9186042,138.8745387,138.923,138.9046667,138.895,138.8696667

But predictably, it gives me a value error since empty strings can't be converted into floats. What I want to do is to pass those empty variables in such a way the associated nodes will do nothing at all, or there won't be a learning, nothing will change etc.

Is there any way to do this?

(There is method for converting the timestaps, I just need to handle the empty strings)


Solution

  • There are a number of ways, but one is to calculate the average value of that column, and pass that in any case where there is missing data. You can also add a column that is True/False for whether or not the data is present, so that the network has the ability to learn that the first column is important only when the second column is True.