Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
85284446
Commit
85284446
authored
Aug 17, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete prints
parent
6a1f914d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
predictDiary.py
predictDiary.py
+2
-2
userProfile.py
userProfile.py
+0
-2
No files found.
predictDiary.py
View file @
85284446
...
...
@@ -101,7 +101,7 @@ def multi_predict(predict_list,processes=12):
if
__name__
==
"__main__"
:
# TODO 如果耗时小于一分钟,下一次取到的device_id和上一次相同
# TODO 如果耗时小于一分钟,下一次取到的device_id和上一次相同
。还有一种情况,一个用户持续活跃,会被重复预测
while
True
:
empty
,
device_id_list
=
get_active_users
()
if
empty
:
...
...
@@ -115,7 +115,7 @@ if __name__ == "__main__":
predict_list
=
list
(
set
(
device_id_list
)
&
set
(
old_device_id_list
))
multi_predict
(
predict_list
)
#TODO 上线前把预测流程中的计时器、打印代码删掉或者注释,因为预测对性能要求高,能少一条
执行语句就少一条执行语句
#TODO 上线前把预测流程中的计时器、打印代码删掉或者注释,因为预测对性能要求高,能少一条
代码语句就少一条
...
...
userProfile.py
View file @
85284446
...
...
@@ -17,7 +17,6 @@ def get_active_users():
device_id_list
=
device_id_df
[
0
]
.
values
.
tolist
()
# 对device_id 进行去重
device_id_list
=
list
(
set
(
device_id_list
))
print
(
"成功获取当下一分钟内活跃用户"
)
return
False
,
device_id_list
...
...
@@ -29,7 +28,6 @@ def fetch_user_profile(device_id):
return
None
,
True
else
:
user_profile
=
user_profile
.
rename
(
columns
=
{
0
:
"device_id"
,
1
:
"city_id"
})
print
(
"成功获取该用户对应的city_id"
)
user_profile_dict
=
{}
for
i
in
user_profile
.
columns
:
user_profile_dict
[
i
]
=
user_profile
.
loc
[
0
,
i
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment