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
e0e8afd0
Commit
e0e8afd0
authored
Sep 01, 2019
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change test
parent
90f92be2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
19 deletions
+22
-19
rerank_esmm.py
rerank_esmm.py
+22
-19
No files found.
rerank_esmm.py
View file @
e0e8afd0
...
@@ -182,25 +182,28 @@ if __name__ == "__main__":
...
@@ -182,25 +182,28 @@ if __name__ == "__main__":
print
(
len
(
users_list
))
print
(
len
(
users_list
))
total_samples
=
list
()
total_samples
=
list
()
name_tag
=
get_searchworlds_to_tagid
()
name_tag
=
get_searchworlds_to_tagid
()
for
uid_city
in
users_list
:
n
=
600
tag_list
=
get_user_profile
(
uid_city
[
0
])
users_list
=
[
a
[
i
:
i
+
n
]
for
i
in
range
(
0
,
len
(
users_list
),
n
)]
queues
=
get_queues
(
uid_city
[
0
],
uid_city
[
1
])
for
child_users_list
in
users_list
:
if
len
(
queues
)
>
0
and
len
(
tag_list
)
>
0
:
for
uid_city
in
child_users_list
:
new_native
=
tag_boost
(
queues
[
0
],
tag_list
)
tag_list
=
get_user_profile
(
uid_city
[
0
])
new_nearby
=
tag_boost
(
queues
[
1
],
tag_list
)
queues
=
get_queues
(
uid_city
[
0
],
uid_city
[
1
])
if
len
(
queues
)
>
0
and
len
(
tag_list
)
>
0
:
insert_time
=
str
(
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y
%
m
%
d
%
H
%
M'
))
new_native
=
tag_boost
(
queues
[
0
],
tag_list
)
sample
=
[
uid_city
[
0
],
uid_city
[
1
],
new_native
,
new_nearby
,
queues
[
2
],
queues
[
3
],
insert_time
]
new_nearby
=
tag_boost
(
queues
[
1
],
tag_list
)
total_samples
.
append
(
sample
)
print
(
len
(
total_samples
))
insert_time
=
str
(
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y
%
m
%
d
%
H
%
M'
))
sample
=
[
uid_city
[
0
],
uid_city
[
1
],
new_native
,
new_nearby
,
queues
[
2
],
queues
[
3
],
insert_time
]
if
len
(
total_samples
)
>
0
:
total_samples
.
append
(
sample
)
df
=
pd
.
DataFrame
(
total_samples
)
print
(
len
(
total_samples
))
df
=
df
.
rename
(
columns
=
{
0
:
"device_id"
,
1
:
"city_id"
,
2
:
"native_queue"
,
3
:
"nearby_queue"
,
4
:
"nation_queue"
,
5
:
"megacity_queue"
,
6
:
"time"
})
if
len
(
total_samples
)
>
0
:
df
=
pd
.
DataFrame
(
total_samples
)
to_data_base
(
df
)
df
=
df
.
rename
(
columns
=
{
0
:
"device_id"
,
1
:
"city_id"
,
2
:
"native_queue"
,
print
(
"good boy"
)
3
:
"nearby_queue"
,
4
:
"nation_queue"
,
5
:
"megacity_queue"
,
6
:
"time"
})
to_data_base
(
df
)
print
(
"good boy"
)
# TODO to kv
# TODO to kv
...
...
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