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
84509b99
Commit
84509b99
authored
Mar 26, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.wanmeizhensuo.com/ML/ffm-baseline
parents
8fa2a506
cf6bc33b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
feature.py
tensnsorflow/es/feature.py
+0
-1
test.py
tensnsorflow/test.py
+23
-1
No files found.
tensnsorflow/es/feature.py
View file @
84509b99
...
...
@@ -95,7 +95,6 @@ def get_data():
train
[
i
]
=
train
[
i
]
.
map
(
value_map
)
test
[
i
]
=
test
[
i
]
.
map
(
value_map
)
print
(
train
[[
"clevel2_id"
,
"channel"
,
"app_list"
]]
.
head
(
6
))
print
(
"train shape"
)
print
(
train
.
shape
)
print
(
"test shape"
)
...
...
tensnsorflow/test.py
View file @
84509b99
...
...
@@ -7,8 +7,23 @@ from pyspark.sql import SQLContext
from
pyspark.sql
import
SparkSession
from
py4j.java_gateway
import
java_import
import
pytispark.pytispark
as
pti
import
pandas
as
pd
import
pymysql
def
con_sql
(
db
,
sql
):
cursor
=
db
.
cursor
()
try
:
cursor
.
execute
(
sql
)
result
=
cursor
.
fetchall
()
df
=
pd
.
DataFrame
(
list
(
result
))
except
Exception
:
print
(
"发生异常"
,
Exception
)
df
=
pd
.
DataFrame
()
finally
:
db
.
close
()
return
df
def
test
():
conf
=
SparkConf
()
.
setAppName
(
"My App"
)
.
set
(
"spark.io.compression.codec"
,
"lzf"
)
...
...
@@ -48,4 +63,10 @@ def esmm_pre():
if
__name__
==
'__main__'
:
esmm_pre
()
try
:
db
=
pymysql
.
connect
(
host
=
'10.66.157.11'
,
port
=
4000
,
user
=
'root'
,
passwd
=
'3SYz54LS9#^9sBvC'
,
db
=
'jerry_test'
)
except
Exception
:
db
=
pymysql
.
connect
(
host
=
'10.66.157.22'
,
port
=
4000
,
user
=
'root'
,
passwd
=
'3SYz54LS9#^9sBvC'
,
db
=
'jerry_test'
)
sql
=
"select max(stat_date) from esmm_train_data"
validate_date
=
con_sql
(
db
,
sql
)[
0
]
.
values
.
tolist
()[
0
]
print
(
"validate_date:"
+
validate_date
)
\ No newline at end of file
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