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
82e9d34d
Commit
82e9d34d
authored
Aug 21, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add share_num for diary
parent
ce6ce8df
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
2 deletions
+28
-2
diary_model.py
src/models/esmm/diary_model.py
+8
-0
diary_fe.py
src/models/esmm/fe/diary_fe.py
+16
-0
train_diary.py
src/train_diary.py
+4
-2
No files found.
src/models/esmm/diary_model.py
View file @
82e9d34d
...
...
@@ -72,6 +72,14 @@ _int_columns = [
"sixty_browse_user_num"
,
"ninety_browse_user_num"
,
"history_browse_user_num"
,
"one_share_num"
,
"three_share_num"
,
"seven_share_num"
,
"fifteen_share_num"
,
"thirty_share_num"
,
"sixty_share_num"
,
"ninety_share_num"
,
"history_share_num"
,
"first_demands_num"
,
"second_demands_num"
,
"first_solutions_num"
,
...
...
src/models/esmm/fe/diary_fe.py
View file @
82e9d34d
...
...
@@ -94,6 +94,14 @@ DIARY_COLUMNS = [
"sixty_ctr"
,
"ninety_ctr"
,
"history_ctr"
,
"one_share_num"
,
"three_share_num"
,
"seven_share_num"
,
"fifteen_share_num"
,
"thirty_share_num"
,
"sixty_share_num"
,
"ninety_share_num"
,
"history_share_num"
,
"first_demands"
,
"second_demands"
,
"first_solutions"
,
...
...
@@ -170,6 +178,14 @@ INT_COLUMNS = [
"sixty_browse_user_num"
,
"ninety_browse_user_num"
,
"history_browse_user_num"
,
"one_share_num"
,
"three_share_num"
,
"seven_share_num"
,
"fifteen_share_num"
,
"thirty_share_num"
,
"sixty_share_num"
,
"ninety_share_num"
,
"history_share_num"
,
"first_demands_num"
,
"second_demands_num"
,
"first_solutions_num"
,
...
...
src/train_diary.py
View file @
82e9d34d
...
...
@@ -61,7 +61,8 @@ def main():
estimator_config
=
tf
.
estimator
.
RunConfig
(
session_config
=
session_config
)
model
=
tf
.
estimator
.
Estimator
(
model_fn
=
esmm_model_fn
,
params
=
params
,
model_dir
=
model_path
,
config
=
estimator_config
)
train_spec
=
tf
.
estimator
.
TrainSpec
(
input_fn
=
lambda
:
esmm_input_fn
(
train_df
,
shuffle
=
True
),
max_steps
=
50000
)
# TODO 50000
train_spec
=
tf
.
estimator
.
TrainSpec
(
input_fn
=
lambda
:
esmm_input_fn
(
train_df
,
shuffle
=
True
),
max_steps
=
20000
)
eval_spec
=
tf
.
estimator
.
EvalSpec
(
input_fn
=
lambda
:
esmm_input_fn
(
val_df
,
shuffle
=
False
))
res
=
tf
.
estimator
.
train_and_evaluate
(
model
,
train_spec
,
eval_spec
)
print
(
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
)
...
...
@@ -73,7 +74,8 @@ def main():
model_export_path
=
str
(
Path
(
"/data/files/models/diary"
)
.
expanduser
())
save_path
=
model_export
(
model
,
all_features
,
model_export_path
)
print
(
"save to: "
+
save_path
)
set_essm_model_save_path
(
"diary"
,
save_path
)
# TODO save
# set_essm_model_save_path("diary", save_path)
print
(
"============================================================"
)
# save_path = str(Path("~/Desktop/models/1596012827").expanduser()) # local
...
...
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