【发布时间】:2020-10-20 14:48:17
【问题描述】:
在 TFRecord 文件中存储/读取数据以训练预测模型的最佳做法是什么?我想建立一个模型,该模型可以根据其历史健康数据(例如,来自一组电机的历史数据,包括每个电机的速度、错误率、故障、等)。
我可以使用 Apache Beam/Dataflow 进行整个预处理(标准化数据、估算缺失值、设计新功能、拆分以训练/验证/测试集等)。但我在想也许最好将原始数据存储为 .tfrecord 文件并使用 TFX 进行标准化、插补等,以使实验更容易。 TFX tensorflow_transform currently doesn't support tf.SequenceExample files。因此,我正在考虑将原始数据存储为 tf.Example 文件,每条记录的格式如下:
example_proto = tf.train.Example(features=tf.train.Features(feature={
'timestamp': tf.train.Feature(int64_list=tf.train.Int64List(
value=[1601200000, 1601200060, 1601200120, ...])),
'feature0': tf.train.Feature(float_list=tf.train.FloatList(
value=[np.nan, 15523.0, np.nan, ...])),
'feature1': tf.train.Feature(float_list=tf.train.FloatList(
value=[1.0, -8.0, np.nan, ...])),
...
'label': tf.train.Feature(float_list=tf.train.FloatList(
value=[0.5, -10.3, 2.1, ...])),
}))
你怎么看?有什么建议吗?
【问题讨论】:
标签: tensorflow apache-beam tensorflow-datasets tfrecord tfx