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
81455a71
Commit
81455a71
authored
Dec 20, 2021
by
宋柯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型调试
parent
2bb65789
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
featureEngSk.py
spark/featureEngSk.py
+5
-5
down_vocab.py
train/down_vocab.py
+4
-4
No files found.
spark/featureEngSk.py
View file @
81455a71
...
@@ -45,10 +45,10 @@ DATA_PATH_TRAIN = "/data/files/service_feature_{}_train.csv".format(VERSION)
...
@@ -45,10 +45,10 @@ DATA_PATH_TRAIN = "/data/files/service_feature_{}_train.csv".format(VERSION)
def
getRedisConn
():
def
getRedisConn
():
#
pool = redis.ConnectionPool(host="172.16.50.145",password="XfkMCCdWDIU%ls$h",port=6379,db=0)
pool
=
redis
.
ConnectionPool
(
host
=
"172.16.50.145"
,
password
=
"XfkMCCdWDIU
%
ls$h"
,
port
=
6379
,
db
=
0
)
#
conn = redis.Redis(connection_pool=pool)
conn
=
redis
.
Redis
(
connection_pool
=
pool
)
# conn = redis.Redis(host="172.16.50.145", port=6379, password="XfkMCCdWDIU%ls$h",db=0)
# conn = redis.Redis(host="172.16.50.145", port=6379, password="XfkMCCdWDIU%ls$h",db=0)
conn
=
redis
.
Redis
(
host
=
"172.18.51.10"
,
port
=
6379
,
db
=
0
)
#test
#
conn = redis.Redis(host="172.18.51.10", port=6379,db=0) #test
return
conn
return
conn
def
parseTags
(
tags
,
i
):
def
parseTags
(
tags
,
i
):
...
@@ -1043,8 +1043,8 @@ if __name__ == '__main__':
...
@@ -1043,8 +1043,8 @@ if __name__ == '__main__':
output_file
=
"/strategy/train_samples"
output_file
=
"/strategy/train_samples"
train_samples
.
write
.
mode
(
"overwrite"
)
.
options
(
header
=
"false"
,
sep
=
'|'
)
.
csv
(
output_file
)
train_samples
.
write
.
mode
(
"overwrite"
)
.
options
(
header
=
"false"
,
sep
=
'|'
)
.
csv
(
output_file
)
output_file
=
"file:///home/gmuser/
test
_samples"
output_file
=
"file:///home/gmuser/
eval
_samples"
output_file
=
"/strategy/
test
_samples"
output_file
=
"/strategy/
eval
_samples"
test_samples
.
write
.
mode
(
"overwrite"
)
.
options
(
header
=
"false"
,
sep
=
'|'
)
.
csv
(
output_file
)
test_samples
.
write
.
mode
(
"overwrite"
)
.
options
(
header
=
"false"
,
sep
=
'|'
)
.
csv
(
output_file
)
print
(
"训练数据写入 耗时s:{}"
.
format
(
time
.
time
()
-
write_time_start
))
print
(
"训练数据写入 耗时s:{}"
.
format
(
time
.
time
()
-
write_time_start
))
...
...
train/down_vocab.py
View file @
81455a71
...
@@ -4,10 +4,10 @@ import os
...
@@ -4,10 +4,10 @@ import os
import
json
import
json
def
getRedisConn
():
def
getRedisConn
():
#
pool = redis.ConnectionPool(host="172.16.50.145",password="XfkMCCdWDIU%ls$h",port=6379,db=0)
pool
=
redis
.
ConnectionPool
(
host
=
"172.16.50.145"
,
password
=
"XfkMCCdWDIU
%
ls$h"
,
port
=
6379
,
db
=
0
)
#
conn = redis.Redis(connection_pool=pool)
conn
=
redis
.
Redis
(
connection_pool
=
pool
)
# conn = redis.Redis(host="172.16.50.145", port=6379, password="XfkMCCdWDIU%ls$h",db=0)
# conn = redis.Redis(host="172.16.50.145", port=6379, password="XfkMCCdWDIU%ls$h",db=0)
conn
=
redis
.
Redis
(
host
=
"172.18.51.10"
,
port
=
6379
,
db
=
0
,
decode_responses
=
True
)
#test
#
conn = redis.Redis(host="172.18.51.10", port=6379, db=0, decode_responses = True) #test
return
conn
return
conn
if
len
(
sys
.
argv
)
==
2
:
if
len
(
sys
.
argv
)
==
2
:
...
@@ -41,5 +41,5 @@ for vocab_key in vocab_keys:
...
@@ -41,5 +41,5 @@ for vocab_key in vocab_keys:
f
.
write
(
'
\n
'
.
join
(
texts
))
f
.
write
(
'
\n
'
.
join
(
texts
))
os
.
system
(
"hdfs dfs -getmerge /strategy/train_samples {save_dir}train_samples.csv"
.
format
(
save_dir
=
save_dir
))
os
.
system
(
"hdfs dfs -getmerge /strategy/train_samples {save_dir}train_samples.csv"
.
format
(
save_dir
=
save_dir
))
os
.
system
(
"hdfs dfs -getmerge /strategy/
test_samples {save_dir}test
_samples.csv"
.
format
(
save_dir
=
save_dir
))
os
.
system
(
"hdfs dfs -getmerge /strategy/
eval_samples {save_dir}eval
_samples.csv"
.
format
(
save_dir
=
save_dir
))
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