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
1a134790
Commit
1a134790
authored
Dec 11, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add data
parent
e7e1fa67
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
ffm.py
tensnsorflow/ffm.py
+11
-8
No files found.
tensnsorflow/ffm.py
View file @
1a134790
...
...
@@ -45,7 +45,14 @@ def get_data():
df
[
"y"
]
.
values
.
tolist
(),
df
[
"z"
]
.
values
.
tolist
()],
sep
=
","
)
df
=
df
.
drop
(
"z"
,
axis
=
1
)
print
(
df
.
head
())
transform
(
df
)
print
(
"shape"
)
print
(
df
.
shape
)
df
=
pd
.
merge
(
df
,
get_statistics
(),
on
=
"device_id"
,
how
=
'left'
)
.
fillna
(
0
)
print
(
"merge"
)
print
(
df
.
head
())
print
(
"shape"
)
print
(
df
.
shape
)
# transform(df)
def
transform
(
df
):
...
...
@@ -91,14 +98,10 @@ def get_statistics():
sql
=
"select device_id,device_type,channel,total,精选,直播,鼻部,眼部,微整,牙齿,轮廓,美肤抗衰,"
\
"吸脂,脂肪填充,隆胸,私密,毛发管理,公立,韩国 from home_tab_click"
df
=
con_sql
(
db
,
sql
)
df
=
df
.
rename
(
columns
=
{
0
:
"device_id"
,
1
:
"device_type"
,
2
:
"channel"
,
3
:
"total"
})
print
(
df
.
head
())
for
i
in
df
.
columns
.
difference
([
"device_id"
,
"device_type"
,
"channel"
,
"total"
]):
df
[
i
]
=
df
[
i
]
/
df
[
"total"
]
print
(
df
.
head
())
return
df
class
multiFFMFormatPandas
:
...
...
@@ -208,5 +211,5 @@ class multiFFMFormatPandas:
if
__name__
==
"__main__"
:
path
=
"/home/gmuser/ffm/"
#
get_data()
get_statistics
()
get_data
()
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