我已获得这种格式的一些数据以及以下详细信息:
person1, day1, feature1, feature2, ..., featureN, label
person1, day2, feature1, feature2, ..., featureN, label
...
person1, dayN, feature1, feature2, ..., featureN, label
person2, day1, feature1, feature2, ..., featureN, label
person2, day2, feature1, feature2, ..., featureN, label
...
person2, dayN, feature1, feature2, ..., featureN, label
...
- 总是有相同数量的特征,但每个特征可能是 0 代表什么都没有
- 每个人的可用天数各不相同,例如person1 有 20 天的数据,person2 有 50 天的数据
The goal是预测第二天该人的标签,因此第 N+1 天的标签,无论是在每个人的基础上,还是在总体上(每个人对我来说更有意义)。我可以自由地重新格式化数据(数据不大)。基于上述内容,经过一番阅读后,我认为动态 RNN (LSTM) 效果最好:
- 循环神经网络:因为第二天依赖于前一天
- lstm:因为模型每天都在建立
- 动态:因为并非所有功能每天都会出现
如果这对我所拥有的数据没有意义,请在这里阻止我。
那么问题是:
如何为tensorflow/tflearn提供/格式化这些数据?
我看过this https://github.com/tflearn/tflearn/blob/master/examples/nlp/dynamic_lstm.py使用 tflearn 的示例,但我不理解它的输入格式,因此我可以将它“镜像”到我的。同样,也发现了this https://stackoverflow.com/questions/39324520/understanding-tensorflow-lstm-input-shape发布了一个非常相似的问题,但发帖者的样本之间似乎并不像我的样本那样相互关联。我对张量流的经验仅限于它开始吧 https://www.tensorflow.org/get_started/get_started page.