Commit 2b8ed592 authored by 宋柯's avatar 宋柯

模型调试

parent a600b18c
...@@ -935,13 +935,12 @@ if __name__ == '__main__': ...@@ -935,13 +935,12 @@ if __name__ == '__main__':
output_file = "file:///home/gmuser/train_samples" output_file = "file:///home/gmuser/train_samples"
output_file = "/strategy/train_samples" output_file = "/strategy/train_samples"
train_samples = spark.read.csv(output_file) train_samples = spark.read.csv(output_file, sep = '|')
train_samples.show(100, False) train_samples.show(100, False)
# train_samples.write.mode("overwrite").options(header="false", sep='|').csv(output_file) # train_samples.write.mode("overwrite").options(header="false", sep='|').csv(output_file)
import tensorflow as tf import tensorflow as tf
def get_example_string(row): def get_example_string(line):
splits = row[0].split('|')
features = { features = {
'ITEM_CATEGORY_card_id': tf.train.Feature(bytes_list=tf.train.BytesList(value=[splits[0].encode()])), 'ITEM_CATEGORY_card_id': tf.train.Feature(bytes_list=tf.train.BytesList(value=[splits[0].encode()])),
'USER_CATEGORY_device_id': tf.train.Feature(bytes_list=tf.train.BytesList(value=[splits[2].encode()])), 'USER_CATEGORY_device_id': tf.train.Feature(bytes_list=tf.train.BytesList(value=[splits[2].encode()])),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment