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
44dda8af
Commit
44dda8af
authored
Jul 15, 2021
by
郭羽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update feature
parent
263eb50a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
featureEng.py
spark/featureEng.py
+4
-2
No files found.
spark/featureEng.py
View file @
44dda8af
...
@@ -216,7 +216,7 @@ def addUserFeatures(samples,dataVocab,multiVocab):
...
@@ -216,7 +216,7 @@ def addUserFeatures(samples,dataVocab,multiVocab):
def
addSampleLabel
(
ratingSamples
):
def
addSampleLabel
(
ratingSamples
):
ratingSamples
=
ratingSamples
.
withColumn
(
'label'
,
when
(
F
.
col
(
'rating'
)
>=
1
,
1
)
.
otherwise
(
0
))
ratingSamples
=
ratingSamples
.
withColumn
(
'label'
,
when
(
F
.
col
(
'rating'
)
>=
8
,
1
)
.
otherwise
(
0
))
ratingSamples
.
show
(
5
,
truncate
=
False
)
ratingSamples
.
show
(
5
,
truncate
=
False
)
ratingSamples
.
printSchema
()
ratingSamples
.
printSchema
()
return
ratingSamples
return
ratingSamples
...
@@ -436,7 +436,9 @@ def getExposureSql(start, end):
...
@@ -436,7 +436,9 @@ def getExposureSql(start, end):
and cl_id IS NOT NULL
and cl_id IS NOT NULL
and card_id IS NOT NULL
and card_id IS NOT NULL
and is_exposure='1'
and is_exposure='1'
and page_name in ('home','search_result_more')
and page_name='home'
and tab_name='精选'
--and page_name in ('home','search_result_more')
and card_type in ('card','video')
and card_type in ('card','video')
and card_content_type in ('service')
and card_content_type in ('service')
and (get_json_object(exposure_card,'$.in_page_pos') is null or get_json_object(exposure_card,'$.in_page_pos') != 'seckill')
and (get_json_object(exposure_card,'$.in_page_pos') is null or get_json_object(exposure_card,'$.in_page_pos') != 'seckill')
...
...
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