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
6b6f8d78
Commit
6b6f8d78
authored
Aug 06, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs
parent
edc69b33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
diary-training.py
diary-training.py
+16
-6
No files found.
diary-training.py
View file @
6b6f8d78
...
...
@@ -128,16 +128,26 @@ data = ffm_train.fit_transform(data, y='y')
print
(
"done transform ffm"
)
data
.
to_csv
(
"/home/zhangyanzhao/data.csv"
,
index
=
False
)
data
=
pd
.
read_csv
(
"/home/zhangyanzhao/data.csv"
,
header
=
None
)
print
(
"数据集大小"
)
print
(
data
.
shape
)
print
(
data
.
head
(
2
))
n
=
np
.
rint
(
data
.
shape
[
0
]
/
8
)
m
=
np
.
rint
(
data
.
shape
[
0
]
*
(
3
/
8
))
# 1/8的数据集用来做测试集
data
.
loc
[:
n
]
.
to_csv
(
"/home/zhangyanzhao/test.csv"
,
index
=
False
,
header
=
None
)
test
=
data
.
loc
[:
n
]
print
(
"测试集大小"
)
print
(
test
.
shape
)
test
.
to_csv
(
"/home/zhangyanzhao/test.csv"
,
index
=
False
,
header
=
None
)
# 1/4的数据集用来做验证集
data
.
loc
[
n
+
1
:
m
]
.
to_csv
(
"/home/zhangyanzhao/validation.csv"
,
index
=
False
,
header
=
None
)
# 剩余的数据集用来做验证集
data
.
loc
[
m
+
1
:]
.
to_csv
(
"/home/zhangyanzhao/train.csv"
,
index
=
False
,
header
=
None
)
# 销毁data,目的是为了节省内存
data
=
data
.
drop
(
data
.
index
.
tolist
())
validation
=
data
.
loc
[
n
+
1
:
m
]
validation
.
to_csv
(
"/home/zhangyanzhao/validation.csv"
,
index
=
False
,
header
=
None
)
print
(
"验证集大小"
)
print
(
validation
.
shape
)
# 剩余的数据集用来做训练集
train
=
data
.
loc
[
m
+
1
:]
print
(
"训练集大小"
)
print
(
train
.
shape
)
train
.
to_csv
(
"/home/zhangyanzhao/train.csv"
,
index
=
False
,
header
=
None
)
print
(
"start training"
)
ffm_model
=
xl
.
create_ffm
()
...
...
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