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
148393ea
Commit
148393ea
authored
Aug 10, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regroup get_active_users,add some prints
parent
4adad597
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
predictDiary.py
predictDiary.py
+3
-3
userProfile.py
userProfile.py
+1
-1
No files found.
predictDiary.py
View file @
148393ea
...
...
@@ -25,8 +25,8 @@ def feature_en(user_profile):
# 虽然预测y,但ffm转化需要y,并不影响预测结果
data
[
"y"
]
=
0
data
=
data
.
drop
(
"city_id"
,
axis
=
1
)
print
(
data
.
head
(
2
))
print
(
data
.
head
(
1
))
print
(
"特征工程处理结束"
)
return
data
...
...
@@ -37,7 +37,7 @@ def transform_ffm_format(df, device_id):
ffm_format_pandas
=
pickle
.
load
(
f
)
data
=
ffm_format_pandas
.
transform
(
df
)
now
=
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d-
%
H-
%
M"
)
print
(
"ffm格式转化结束"
)
predict_file_name
=
DIRECTORY_PATH
+
"result/{0}_{1}DiaryTop2000.csv"
.
format
(
device_id
,
now
)
data
.
to_csv
(
predict_file_name
,
index
=
False
,
header
=
None
)
return
predict_file_name
...
...
userProfile.py
View file @
148393ea
...
...
@@ -27,7 +27,7 @@ def fetch_user_profile(device_id):
if
user_profile
.
empty
:
print
(
"没有获取到该用户对应的city_id"
)
return
{},
user_profile
.
empty
else
:
user_profile
=
user_profile
.
rename
(
columns
=
{
0
:
"device_id"
,
1
:
"city_id"
})
print
(
"成功获取该用户对应的city_id"
)
user_profile_dict
=
{}
...
...
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