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
e24d26a6
Commit
e24d26a6
authored
Sep 01, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update auc info to db
parent
795c2040
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
train_diary.py
src/train_diary.py
+1
-1
train_tractate.py
src/train_tractate.py
+1
-1
db.py
src/utils/db.py
+4
-3
No files found.
src/train_diary.py
View file @
e24d26a6
...
...
@@ -79,7 +79,7 @@ def main():
save_path
=
model_export
(
model
,
all_features
,
model_export_path
)
print
(
"save to: "
+
save_path
)
set_essm_model_save_path
(
"diary"
,
save_path
)
record_esmm_auc_to_db
(
"diary"
,
ctr_auc
,
ctcvr_auc
,
total_time
)
record_esmm_auc_to_db
(
"diary"
,
ctr_auc
,
ctcvr_auc
,
total_time
,
save_path
)
print
(
"============================================================"
)
# save_path = str(Path("~/Desktop/models/1596012827").expanduser()) # local
...
...
src/train_tractate.py
View file @
e24d26a6
...
...
@@ -75,7 +75,7 @@ def main():
save_path
=
model_export
(
model
,
all_features
,
model_export_path
)
print
(
"save to: "
+
save_path
)
set_essm_model_save_path
(
"tractate"
,
save_path
)
record_esmm_auc_to_db
(
"tractate"
,
ctr_auc
,
ctcvr_auc
,
total_time
)
record_esmm_auc_to_db
(
"tractate"
,
ctr_auc
,
ctcvr_auc
,
total_time
,
save_path
)
print
(
"============================================================"
)
# save_path = get_essm_model_save_path("tractate")
...
...
src/utils/db.py
View file @
e24d26a6
...
...
@@ -20,13 +20,14 @@ def _write_data_to_mysql(host, port, user, passwd, db, sql):
# `ctr_auc` text NOT NULL,
# `ctcvr_auc` text NOT NULL,
# `cost` text NOT NULL,
# `save_path` text NOT NULL,
# `date` datetime,
# PRIMARY KEY(`id`)
# )
def
record_esmm_auc_to_db
(
content_type
,
ctr_auc
,
ctcvr_auc
,
cost
):
def
record_esmm_auc_to_db
(
content_type
,
ctr_auc
,
ctcvr_auc
,
cost
,
save_path
):
dt
=
datetime
.
datetime
.
now
()
t
=
dt
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
sql
=
"""
INSERT INTO esmm_auc_log(content_type, ctr_auc, ctcvr_auc, cost,
date) VALUES (
'{}', '{}', '{}', '{}', '{}')
"""
.
format
(
content_type
,
ctr_auc
,
ctcvr_auc
,
cost
,
t
)
INSERT INTO esmm_auc_log(content_type, ctr_auc, ctcvr_auc, cost,
save_path, date) VALUES ('{}',
'{}', '{}', '{}', '{}', '{}')
"""
.
format
(
content_type
,
ctr_auc
,
ctcvr_auc
,
cost
,
save_path
,
t
)
return
_write_data_to_mysql
(
"172.16.40.170"
,
4000
,
"st_user"
,
"aqpuBLYzEV7tML5RPsN1pntUzFy"
,
"jerry_test"
,
sql
)
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