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
edc69b33
Commit
edc69b33
authored
Aug 06, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix little bugs
parent
0264441d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
diary-training.py
diary-training.py
+7
-2
No files found.
diary-training.py
View file @
edc69b33
...
@@ -41,7 +41,11 @@ exposure = exposure.loc[exposure["device_id"].isin(click_device_id)]
...
@@ -41,7 +41,11 @@ exposure = exposure.loc[exposure["device_id"].isin(click_device_id)]
# 打标签
# 打标签
click
[
"y"
]
=
1
click
[
"y"
]
=
1
exposure
[
"y"
]
=
0
exposure
[
"y"
]
=
0
print
(
"成功获取正负样本"
)
print
(
"正样本个数"
)
print
(
click
.
shape
[
0
])
print
(
"负样本个数"
)
print
(
exposure
.
shape
[
0
])
# 合并点击表和曝光表
# 合并点击表和曝光表
data
=
click
.
append
(
exposure
)
data
=
click
.
append
(
exposure
)
...
@@ -122,7 +126,8 @@ class FFMFormatPandas:
...
@@ -122,7 +126,8 @@ class FFMFormatPandas:
ffm_train
=
FFMFormatPandas
()
ffm_train
=
FFMFormatPandas
()
data
=
ffm_train
.
fit_transform
(
data
,
y
=
'y'
)
data
=
ffm_train
.
fit_transform
(
data
,
y
=
'y'
)
print
(
"done transform ffm"
)
print
(
"done transform ffm"
)
data
.
to_csv
(
"/home/zhangyanzhao/data.csv"
,
index
=
False
)
data
=
pd
.
read_csv
(
"/home/zhangyanzhao/data.csv"
,
header
=
None
)
n
=
np
.
rint
(
data
.
shape
[
0
]
/
8
)
n
=
np
.
rint
(
data
.
shape
[
0
]
/
8
)
m
=
np
.
rint
(
data
.
shape
[
0
]
*
(
3
/
8
))
m
=
np
.
rint
(
data
.
shape
[
0
]
*
(
3
/
8
))
# 1/8的数据集用来做测试集
# 1/8的数据集用来做测试集
...
...
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