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
2c1f7d0d
Commit
2c1f7d0d
authored
Mar 14, 2019
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change eda
parent
2c4c9641
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
eda.py
tensnsorflow/eda.py
+2
-2
feature.py
tensnsorflow/es/feature.py
+1
-1
No files found.
tensnsorflow/eda.py
View file @
2c1f7d0d
...
...
@@ -17,7 +17,7 @@ def con_sql(db, sql):
def
test
(
days
):
start
=
(
temp
-
datetime
.
timedelta
(
days
))
.
strftime
(
"
%
Y-
%
m-
%
d"
)
print
(
start
)
sql
=
"select (select count(*) from train_data where stat_date = '{}' and y = 0)/(select count(*) "
\
sql
=
"select (select count(*) from
esmm_
train_data where stat_date = '{}' and y = 0)/(select count(*) "
\
"from train_data where stat_date = '{}' and z = 1)"
.
format
(
start
,
start
)
db
=
pymysql
.
connect
(
host
=
'10.66.157.22'
,
port
=
4000
,
user
=
'root'
,
passwd
=
'3SYz54LS9#^9sBvC'
,
db
=
'jerry_test'
)
exp
=
con_sql
(
db
,
sql
)
...
...
@@ -31,7 +31,7 @@ def test(days):
if
__name__
==
"__main__"
:
temp
=
datetime
.
datetime
.
strptime
(
"2019-03-14"
,
"
%
Y-
%
m-
%
d"
)
DIRECTORY_PATH
=
"/home/gmuser/"
output_path
=
DIRECTORY_PATH
+
"eda.csv"
output_path
=
DIRECTORY_PATH
+
"e
smm_train_e
da.csv"
for
i
in
range
(
1
,
41
):
a
,
b
,
c
=
test
(
i
)
with
open
(
output_path
,
'a+'
)
as
f
:
...
...
tensnsorflow/es/feature.py
View file @
2c1f7d0d
...
...
@@ -115,7 +115,7 @@ def get_predict(date,value_map):
"from esmm_pre_data e left join user_feature u on e.device_id = u.device_id "
\
"left join cid_type_top c on e.device_id = c.device_id "
\
"left join cid_level2 cl on e.cid_id = cl.cid "
\
"left join cid_time_cut cut on e.cid_id = cut.cid"
"left join cid_time_cut cut on e.cid_id = cut.cid
limit 6
"
df
=
con_sql
(
db
,
sql
)
df
=
df
.
rename
(
columns
=
{
0
:
"y"
,
1
:
"z"
,
2
:
"label"
,
3
:
"ucity_id"
,
4
:
"clevel1_id"
,
5
:
"ccity_name"
,
6
:
"device_type"
,
7
:
"manufacturer"
,
8
:
"channel"
,
9
:
"top"
,
10
:
"l1"
,
11
:
"l2"
,
...
...
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