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
751ba854
Commit
751ba854
authored
Aug 10, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix train main function
parent
f25887eb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
predictDiary.py
predictDiary.py
+4
-1
processData.py
processData.py
+1
-1
train.py
train.py
+2
-3
No files found.
predictDiary.py
View file @
751ba854
...
...
@@ -100,9 +100,12 @@ if __name__ == "__main__":
if
empty
:
time
.
sleep
(
10
)
else
:
old_device_id_list
=
pd
.
read_csv
(
DIRECTORY_PATH
+
"data_set_device_id.csv"
)[
"device_id"
]
.
values
()
.
tolist
()
for
device_id
in
device_id_list
:
if
device_id
in
old_device_id_list
:
router
(
device_id
)
else
:
print
(
"该用户不是老用户,不能预测"
)
end
=
time
.
time
()
time_cost
=
(
end
-
start
)
print
(
"耗时{}秒"
.
format
(
time_cost
))
...
...
processData.py
View file @
751ba854
...
...
@@ -66,7 +66,7 @@ def feature_en():
device_id_df
[
'device_id'
]
=
data_set_device_id
print
(
"data_set_device_id :"
)
print
(
device_id_df
.
head
(
2
))
device_id_df
.
to_csv
(
DIRECTORY_PATH
+
"device_id.csv"
,
index
=
False
)
device_id_df
.
to_csv
(
DIRECTORY_PATH
+
"d
ata_set_d
evice_id.csv"
,
index
=
False
)
return
data
,
test_number
,
validation_number
...
...
train.py
View file @
751ba854
...
...
@@ -5,10 +5,9 @@ from diaryCandidateSet import get_eachCityDiaryTop3000
# 把数据获取、特征转换、模型训练的模型串联在一起
if
__name__
==
"__main__"
:
data
_fe
=
feature_en
()
ffm_transform
(
data
_fe
)
data
,
test_number
,
validation_number
=
feature_en
()
ffm_transform
(
data
,
test_number
,
validation_number
)
train
()
print
(
"end"
)
# print('---------------prepare candidates--------------')
# get_eachCityDiaryTop3000()
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