Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm_strategy_cvr
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
gm_strategy_cvr
Commits
831ec291
Commit
831ec291
authored
Jul 22, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prediction
parent
048ff9c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
62 deletions
+5
-62
main.py
src/main.py
+5
-62
No files found.
src/main.py
View file @
831ec291
...
...
@@ -92,68 +92,11 @@ def main():
device_ids
=
list
(
device_dict
.
keys
())[:
20
]
diary_ids
=
list
(
diary_dict
.
keys
())
model_predict2
(
random
.
sample
(
device_ids
,
1
)[
0
],
random
.
sample
(
diary_ids
,
300
),
device_dict
,
diary_dict
,
predict_fn
)
# def test1():
# time_1 = timeit.default_timer()
# user1 = join_device_diary(random.sample(device_ids, 1)[0], random.sample(diary_ids, 300), redis_device_df, redis_diary_df)
# total_1 = (timeit.default_timer() - time_1)
# print("join df cost {:.5f}s".format(total_1))
# time_1 = timeit.default_timer()
# model_predict(user1, predict_fn)
# total_1 = (timeit.default_timer() - time_1)
# print("total prediction cost {:.5f}s".format(total_1), "\n")
# def test2():
# time_1 = timeit.default_timer()
# user1 = join_device_diary(random.sample(device_ids, 1)[0], random.sample(diary_ids, 300), redis_device_df, redis_diary_df)
# total_1 = (timeit.default_timer() - time_1)
# print("join df cost {:.5f}s".format(total_1))
# time_1 = timeit.default_timer()
# model_predict(user1, predict_fn)
# total_1 = (timeit.default_timer() - time_1)
# print("total prediction cost {:.5f}s".format(total_1), "\n")
# def test3():
# time_1 = timeit.default_timer()
# user1 = join_device_diary(random.sample(device_ids, 1)[0], random.sample(diary_ids, 300), redis_device_df, redis_diary_df)
# total_1 = (timeit.default_timer() - time_1)
# print("join df cost {:.5f}s".format(total_1))
# time_1 = timeit.default_timer()
# model_predict(user1, predict_fn)
# total_1 = (timeit.default_timer() - time_1)
# print("total prediction cost {:.5f}s".format(total_1), "\n")
# def test4():
# time_1 = timeit.default_timer()
# user1 = join_device_diary(random.sample(device_ids, 1)[0], random.sample(diary_ids, 300), redis_device_df, redis_diary_df)
# total_1 = (timeit.default_timer() - time_1)
# print("join df cost {:.5f}s".format(total_1))
# time_1 = timeit.default_timer()
# model_predict(user1, predict_fn)
# total_1 = (timeit.default_timer() - time_1)
# print("total prediction cost {:.5f}s".format(total_1), "\n")
# def test5():
# time_1 = timeit.default_timer()
# user1 = join_device_diary(random.sample(device_ids, 1)[0], random.sample(diary_ids, 300), redis_device_df, redis_diary_df)
# total_1 = (timeit.default_timer() - time_1)
# print("join df cost {:.5f}s".format(total_1))
# time_1 = timeit.default_timer()
# model_predict(user1, predict_fn)
# total_1 = (timeit.default_timer() - time_1)
# print("total prediction cost {:.5f}s".format(total_1), "\n")
# test1()
# test2()
# test3()
# test4()
# test5()
for
i
in
range
(
5
):
time_1
=
timeit
.
default_timer
()
model_predict2
(
random
.
sample
(
device_ids
,
1
)[
0
],
random
.
sample
(
diary_ids
,
300
),
device_dict
,
diary_dict
,
predict_fn
)
total_1
=
(
timeit
.
default_timer
()
-
time_1
)
print
(
"total prediction cost {:.5f}s"
.
format
(
total_1
),
"
\n
"
)
total_time
=
(
time
.
time
()
-
time_begin
)
/
60
print
(
"total cost {:.2f} mins at {}"
.
format
(
total_time
,
datetime
.
now
()))
...
...
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