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
9d70d94d
Commit
9d70d94d
authored
Dec 12, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change transform
parent
5f47c101
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
ffm.py
tensnsorflow/ffm.py
+4
-10
No files found.
tensnsorflow/ffm.py
View file @
9d70d94d
...
...
@@ -107,20 +107,14 @@ def transform(df,validate_date):
def
get_statistics
():
db
=
pymysql
.
connect
(
host
=
'10.66.157.22'
,
port
=
4000
,
user
=
'root'
,
passwd
=
'3SYz54LS9#^9sBvC'
,
db
=
'eagle'
)
sql
=
"select device_id,device_type,total,精选,直播,鼻部,眼部,微整,牙齿,轮廓,美肤抗衰,"
\
"吸脂,脂肪填充,隆胸,私密,毛发管理,公立,韩国 from home_tab_click
limit 200
"
df
=
con_sql
(
db
,
sql
)
.
drop_duplicates
()
"吸脂,脂肪填充,隆胸,私密,毛发管理,公立,韩国 from home_tab_click"
df
=
con_sql
(
db
,
sql
)
df
=
df
.
rename
(
columns
=
{
0
:
"device_id"
,
1
:
"os"
,
2
:
"total"
})
for
i
in
df
.
columns
.
difference
([
"device_id"
,
"os"
,
"total"
]):
df
[
i
]
=
df
[
i
]
/
df
[
"total"
]
df
[
i
]
=
df
[
i
]
.
apply
(
lambda
x
:
format
(
x
,
".4f"
))
df
[
i
]
=
df
[
i
]
.
astype
(
"float"
)
df
=
df
.
drop
(
"total"
,
axis
=
1
)
df
[
"y"
]
=
1
model
=
multiFFMFormatPandas
()
df
=
model
.
fit_transform
(
df
,
y
=
"y"
,
n
=
100000
,
processes
=
18
)
df
=
pd
.
DataFrame
(
df
)
print
(
df
.
head
())
return
df
...
...
@@ -231,6 +225,6 @@ 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