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
5735a20e
Commit
5735a20e
authored
Jul 30, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try predict
parent
da5833cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
tractate_model.py
src/models/esmm/tractate_model.py
+16
-4
No files found.
src/models/esmm/tractate_model.py
View file @
5735a20e
...
...
@@ -2,7 +2,7 @@ import timeit
import
tensorflow
as
tf
from
.fe.tractate_fe
import
(
CATEGORICAL_COLUMNS
,
FLOAT_COLUMNS
,
INT_COLUMNS
,
device_tractate_fe
)
from
.fe.tractate_fe
import
device_tractate_fe
from
.model
import
_bytes_feature
,
_float_feature
,
_int64_feature
...
...
@@ -11,9 +11,21 @@ def model_predict_tractate(device_id, tractate_ids, device_dict, tractate_dict,
time_1
=
timeit
.
default_timer
()
device_info
,
tractate_lst
,
tractate_ids_res
=
device_tractate_fe
(
device_id
,
tractate_ids
,
device_dict
,
tractate_dict
)
print
(
"predict check: "
+
str
(
len
(
tractate_lst
))
+
" "
+
str
(
len
(
tractate_ids_res
)))
int_columns
=
INT_COLUMNS
float_columns
=
FLOAT_COLUMNS
str_columns
=
CATEGORICAL_COLUMNS
# TODO
int_columns
=
[
"active_type"
,
"active_days"
,
"card_id"
,
"is_pure_author"
,
"is_have_reply"
,
"is_have_pure_reply"
,
"content_level"
,
"reply_num"
,
"reply_pure_num"
,
"show_tag_id"
]
float_columns
=
[
"one_ctr"
,
"three_ctr"
,
"seven_ctr"
,
"fifteen_ctr"
,
"thirty_ctr"
,
"sixty_ctr"
,
"ninety_ctr"
,
"history_ctr"
]
str_columns
=
[
"device_id"
,
"past_consume_ability_history"
,
"potential_consume_ability_history"
,
"price_sensitive_history"
,
"device_fd"
,
"device_sd"
,
"device_fs"
,
"device_ss"
,
"device_fp"
,
"device_sp"
,
"device_p"
,
"content_fd"
,
"content_sd"
,
"content_fs"
,
"content_ss"
,
"content_fp"
,
"content_sp"
,
"content_p"
,
"fd1"
,
"fd2"
,
"fd3"
,
"sd1"
,
"sd2"
,
"sd3"
,
"fs1"
,
"fs2"
,
"fs3"
,
"ss1"
,
"ss2"
,
"ss3"
,
"fp1"
,
"fp2"
,
"fp3"
,
"sp1"
,
"sp2"
,
"sp3"
,
"p1"
,
"p2"
,
"p3"
,
"click_tractate_id1"
,
"click_tractate_id2"
,
"click_tractate_id3"
,
"click_tractate_id4"
,
"click_tractate_id5"
]
examples
=
[]
for
tractate_info
in
tractate_lst
:
tmp
=
{}
...
...
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