Commit 4adad597 authored by 张彦钊's avatar 张彦钊

Merge branch 'master' of git.wanmeizhensuo.com:ML/ffm-baseline

change redis function for test
parents bcb893e9 8ced0dee
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -34,7 +34,7 @@ def df2file(df,fpath):
tplt = "{0:^10}\t{1:^10}\n"
f.write("#2. Top特征\n")
f.write("=================================================================\n")
f.write("2.1用户点击次数分布(第一列:用户点击次数;第二列:独立用户数量)\n")
f.write("2.1 用户点击次数分布(第一列:用户点击次数;第二列:独立用户数量)\n")
f.write(tplt.format("click_times","count_uid"))
for row in df.iterrows():
line = tplt.format(row[1][0],row[1][1])
......
......@@ -21,7 +21,7 @@ def tuple2dict(tuple_result):
def result2file(result_lst,fpath):
with open(fpath,'w') as f:
tplt = "{0:\u3000<4}\t{1:\u3000<12}\t{2:\u3000^6}\t{3:\u3000^6}\t{4:\u3000<8}\t{5:\u3000^15}\n"
f.write("Top 100 Answer\n")
f.write("2.3 Top 100 Answer\n")
f.write("=================================================================\n")
f.write(tplt.format("平台","answer_id","点击数","曝光数","点击率","answer链接"))
for i in result_lst:
......
......@@ -21,7 +21,7 @@ def tuple2dict(tuple_result):
def result2file(result_lst,fpath):
with open(fpath,'w') as f:
tplt = "{0:\u3000<4}\t{1:\u3000<12}\t{2:\u3000^6}\t{3:\u3000^6}\t{4:\u3000<8}\t{5:\u3000^15}\n"
f.write("Top 100 diary\n")
f.write("2.2 Top 100 diary\n")
f.write("=================================================================\n")
f.write(tplt.format("平台","diary_id","点击数","曝光数","点击率","diary链接"))
for i in result_lst:
......
......@@ -21,7 +21,7 @@ def tuple2dict(tuple_result):
def result2file(result_lst,fpath):
with open(fpath,'w') as f:
tplt = "{0:\u3000<4}\t{1:\u3000<12}\t{2:\u3000^6}\t{3:\u3000^6}\t{4:\u3000<8}\t{5:\u3000^15}\n"
f.write("Top 100 Question(曝光表里cid类型没有question,因此下面的曝光数和点击率都为0)\n")
f.write("2.4 Top 100 Question(曝光表里cid类型没有question,因此下面的曝光数和点击率都为0)\n")
f.write("=================================================================\n")
f.write(tplt.format("平台","question_id","点击数","曝光数","点击率","question链接"))
for i in result_lst:
......
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