Commit e8059b5b authored by 郭羽's avatar 郭羽

美购精排模型

parent e151a48f
...@@ -242,6 +242,7 @@ def getDataVocab(samples): ...@@ -242,6 +242,7 @@ def getDataVocab(samples):
tagSet.add("-1") #空值默认 tagSet.add("-1") #空值默认
multiVocab[c] = list(tagSet) multiVocab[c] = list(tagSet)
samples = samples.drop(c) samples = samples.drop(c)
print(c, len(dataVocab[c]))
for c in samples.columns: for c in samples.columns:
# 判断是否以Bucket结尾 和 类别特征 # 判断是否以Bucket结尾 和 类别特征
...@@ -253,14 +254,13 @@ def getDataVocab(samples): ...@@ -253,14 +254,13 @@ def getDataVocab(samples):
vocabSet.add(str(d[c])) vocabSet.add(str(d[c]))
vocabSet.add("-1")# 空值的默认 vocabSet.add("-1")# 空值的默认
dataVocab[c] = list(vocabSet) dataVocab[c] = list(vocabSet)
print(c, len(dataVocab[c]))
else: else:
# 判断是否多值离散列 # 判断是否多值离散列
for cc, v in multiVocab.items(): for cc, v in multiVocab.items():
if c.count(cc) > 0: if c.count(cc) > 0:
dataVocab[c] = v dataVocab[c] = v
print(c,len(dataVocab[c]))
return dataVocab return dataVocab
def dataVocabToRedis(dataVocab): def dataVocabToRedis(dataVocab):
......
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