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
73d57ec8
Commit
73d57ec8
authored
Apr 19, 2019
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
把数据库改成腾讯云
parent
d6dbc200
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
8 deletions
+3
-8
feature.py
eda/esmm/Model_pipline/feature.py
+1
-1
to_database.py
eda/esmm/Model_pipline/to_database.py
+2
-3
to_tfrecord.py
eda/esmm/Model_pipline/to_tfrecord.py
+0
-2
train.py
eda/esmm/Model_pipline/train.py
+0
-2
No files found.
eda/esmm/Model_pipline/feature.py
View file @
73d57ec8
...
...
@@ -37,7 +37,7 @@ def get_data():
validate_date
=
con_sql
(
db
,
sql
)[
0
]
.
values
.
tolist
()[
0
]
print
(
"validate_date:"
+
validate_date
)
temp
=
datetime
.
datetime
.
strptime
(
validate_date
,
"
%
Y-
%
m-
%
d"
)
start
=
(
temp
-
datetime
.
timedelta
(
days
=
3
00
))
.
strftime
(
"
%
Y-
%
m-
%
d"
)
start
=
(
temp
-
datetime
.
timedelta
(
days
=
3
))
.
strftime
(
"
%
Y-
%
m-
%
d"
)
print
(
start
)
db
=
pymysql
.
connect
(
host
=
'172.16.40.158'
,
port
=
4000
,
user
=
'root'
,
passwd
=
'3SYz54LS9#^9sBvC'
,
db
=
'jerry_test'
)
sql
=
"select e.y,e.z,e.stat_date,e.ucity_id,feat.level2_ids,e.ccity_name,u.device_type,u.manufacturer,"
\
...
...
eda/esmm/Model_pipline/to_database.py
View file @
73d57ec8
...
...
@@ -3,7 +3,7 @@
from
sqlalchemy
import
create_engine
import
pandas
as
pd
import
pymysql
import
time
import
date
time
def
con_sql
(
sql
):
"""
...
...
@@ -60,8 +60,7 @@ def main():
df_all
=
pd
.
merge
(
df3
,
df4
,
on
=
[
'device_id'
,
'city_id'
],
how
=
'outer'
)
.
fillna
(
""
)
df_all
[
'device_id'
]
=
df_all
[
'device_id'
]
.
astype
(
str
)
df_all
[
'city_id'
]
=
df_all
[
'city_id'
]
.
astype
(
str
)
ctime
=
int
(
time
.
time
())
df_all
[
"time"
]
=
ctime
df_all
[
"time"
]
=
str
(
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y
%
m
%
d
%
H
%
M'
))
print
(
"union_device_count"
,
df_all
.
shape
)
host
=
'172.16.40.158'
...
...
eda/esmm/Model_pipline/to_tfrecord.py
View file @
73d57ec8
...
...
@@ -4,13 +4,11 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
pandas
as
pd
import
sys
import
os
import
glob
import
tensorflow
as
tf
import
numpy
as
np
import
re
from
multiprocessing
import
Pool
as
ThreadPool
flags
=
tf
.
app
.
flags
...
...
eda/esmm/Model_pipline/train.py
View file @
73d57ec8
...
...
@@ -6,12 +6,10 @@
#import argparse
import
shutil
#import sys
import
os
import
json
import
glob
from
datetime
import
date
,
timedelta
from
time
import
time
import
random
import
tensorflow
as
tf
...
...
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