Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
serviceRec
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郭羽
serviceRec
Commits
f74cd085
Commit
f74cd085
authored
Jul 30, 2021
by
郭羽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
service model 优化
parent
2d97dda5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
featureEng2.py
spark/featureEng2.py
+1
-1
No files found.
spark/featureEng2.py
View file @
f74cd085
...
@@ -335,7 +335,7 @@ def itemFeaturesToRedis(samples,itemDF,columns,redisKey):
...
@@ -335,7 +335,7 @@ def itemFeaturesToRedis(samples,itemDF,columns,redisKey):
conn
.
set
(
newKey
,
v
)
conn
.
set
(
newKey
,
v
)
conn
.
expire
(
newKey
,
60
*
60
*
24
*
7
)
conn
.
expire
(
newKey
,
60
*
60
*
24
*
7
)
item_static_columns
=
[
col
for
col
in
samples
.
columns
if
col
.
endswith
(
"Bucket"
)
or
col
.
endswith
(
"_number"
)]
item_static_columns
=
[
idCol
]
+
[
col
for
col
in
columns
if
col
.
endswith
(
"Bucket"
)
or
col
.
endswith
(
"_number"
)]
#根据timestamp获取每个user最新的记录
#根据timestamp获取每个user最新的记录
prefixSamples
=
samples
.
groupBy
(
idCol
)
.
agg
(
F
.
max
(
"timestamp"
)
.
alias
(
timestampCol
))
prefixSamples
=
samples
.
groupBy
(
idCol
)
.
agg
(
F
.
max
(
"timestamp"
)
.
alias
(
timestampCol
))
...
...
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