python-3.x - 0 和 1 的 Tensorflow 特征列

标签 python-3.x tensorflow

对于 Tensorflow 特征列包含 bool 值 0 和 1。

我应该使用 tf.feature_column.numeric_column

tf.feature_column.categorical_column_with_vocabulary_list

最佳答案

您可以使用 sequence_categorical_column_with_identity :

tf.feature_column.sequence_categorical_column_with_identity('YOUR_FEATURE',2)

第二个参数是桶的数量。如果你的特征中有 n 个连续的整数 [0,1,2 .. ,n-1],那么你可以这样写:

tf.feature_column.sequence_categorical_column_with_identity('YOUR_FEATURE',n)

关于python-3.x - 0 和 1 的 Tensorflow 特征列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47646159/

相关文章:

python - 使用索引和值过滤 Pandas 系列

tensorflow - tf.data.Dataset 中队列的容量

python - TimeDistributed 层的 CNN-LSTM 时间序列输入

tensorflow - 如何获取tensorflow RNN的摘要信息

python - 如何在 Jupyter 笔记本中建立超链接?

python - 导入错误: cannot import name 'Enum' from 'discord' (unknown location)

linux - 通过 crontab 启动脚本时 Python 请求挂起

python - Python 2.7 和 3 之间的多重继承差异

neural-network - 图表可视化未显示在 seq2seq 模型的张量板上

python - 在窗口分类上使用 Tensorflow 时嵌入向量未更新