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
94cfb9ad
Commit
94cfb9ad
authored
4 years ago
by
郭羽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
美购精排模型
parent
bb060dc7
master
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
7 deletions
+2
-7
featureeng_export.sh
shell/featureeng_export.sh
+0
-1
featureEng.py
spark/featureEng.py
+2
-6
No files found.
shell/featureeng_export.sh
View file @
94cfb9ad
path
=
/srv/apps/serviceRec
path
=
/srv/apps/serviceRec
day_count
=
$1
day_count
=
$1
content_type
=
"service"
content_type
=
"service"
source
/srv/envs/serviceRec/bin/activate
pythonFile
=
${
path
}
/spark/featureEng.py
pythonFile
=
${
path
}
/spark/featureEng.py
#log_file=~/${content_type}_feature_csv_export.log
#log_file=~/${content_type}_feature_csv_export.log
/opt/hadoop/bin/hdfs dfs
-rmr
/
${
content_type
}
_feature_train
/opt/hadoop/bin/hdfs dfs
-rmr
/
${
content_type
}
_feature_train
...
...
This diff is collapsed.
Click to expand it.
spark/featureEng.py
View file @
94cfb9ad
...
@@ -270,15 +270,11 @@ def featureColumnsToRedis(columns):
...
@@ -270,15 +270,11 @@ def featureColumnsToRedis(columns):
def
featureToRedis
(
key
,
datas
):
def
featureToRedis
(
key
,
datas
):
conn
=
connUtils
.
getRedisConn
()
conn
=
connUtils
.
getRedisConn
()
pipeline
=
conn
.
pipeline
()
for
k
,
v
in
datas
.
items
():
for
k
,
v
in
datas
.
items
():
newKey
=
key
+
k
newKey
=
key
+
k
pipeline
.
set
(
newKey
,
v
)
conn
.
set
(
newKey
,
v
)
pipeline
.
expire
(
newKey
,
60
*
60
*
24
*
7
)
conn
.
expire
(
newKey
,
60
*
60
*
24
*
7
)
pipeline
.
execute
()
pipeline
.
close
()
conn
.
close
()
def
collectFeaturesToDict
(
samples
,
columns
,
prefix
):
def
collectFeaturesToDict
(
samples
,
columns
,
prefix
):
idCol
=
prefix
+
"id"
idCol
=
prefix
+
"id"
...
...
This diff is collapsed.
Click to expand it.
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