Commit 94cfb9ad authored by 郭羽's avatar 郭羽

美购精排模型

parent bb060dc7
path=/srv/apps/serviceRec path=/srv/apps/serviceRec
day_count=$1 day_count=$1
content_type="service" content_type="service"
source /srv/envs/serviceRec/bin/activate
pythonFile=${path}/spark/featureEng.py pythonFile=${path}/spark/featureEng.py
#log_file=~/${content_type}_feature_csv_export.log #log_file=~/${content_type}_feature_csv_export.log
/opt/hadoop/bin/hdfs dfs -rmr /${content_type}_feature_train /opt/hadoop/bin/hdfs dfs -rmr /${content_type}_feature_train
......
...@@ -270,15 +270,11 @@ def featureColumnsToRedis(columns): ...@@ -270,15 +270,11 @@ def featureColumnsToRedis(columns):
def featureToRedis(key,datas): def featureToRedis(key,datas):
conn = connUtils.getRedisConn() conn = connUtils.getRedisConn()
pipeline = conn.pipeline()
for k,v in datas.items(): for k,v in datas.items():
newKey = key+k newKey = key+k
pipeline.set(newKey,v) conn.set(newKey,v)
pipeline.expire(newKey, 60 * 60 * 24 * 7) conn.expire(newKey, 60 * 60 * 24 * 7)
pipeline.execute()
pipeline.close()
conn.close()
def collectFeaturesToDict(samples,columns,prefix): def collectFeaturesToDict(samples,columns,prefix):
idCol = prefix+"id" idCol = prefix+"id"
......
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