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
a530634f
Commit
a530634f
authored
6 years ago
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change test file
parent
4076cd57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
multi_hot.py
tensnsorflow/multi_hot.py
+3
-3
train_tag.py
tensnsorflow/train_tag.py
+3
-3
No files found.
tensnsorflow/multi_hot.py
View file @
a530634f
...
...
@@ -241,8 +241,8 @@ def feature_engineer():
f
=
time
.
time
()
spark
.
createDataFrame
(
train
)
.
toDF
(
"y"
,
"z"
,
"app_list"
,
"level2_list"
,
"level3_list"
,
"tag1_list"
,
"tag2_list"
,
"tag3_list"
,
"tag4_list"
,
"tag5_list"
,
"tag6_list"
,
"tag7_list"
,
"ids"
,
"search_tag2
"
,
"search_tag3
"
)
\
.
repartition
(
1
)
.
write
.
format
(
"tfrecords"
)
.
save
(
path
=
path
+
"t
est_t
r/"
,
mode
=
"overwrite"
)
"tag5_list"
,
"tag6_list"
,
"tag7_list"
,
"ids"
,
"search_tag2
_list"
,
"search_tag3_list
"
)
\
.
repartition
(
1
)
.
write
.
format
(
"tfrecords"
)
.
save
(
path
=
path
+
"tr/"
,
mode
=
"overwrite"
)
h
=
time
.
time
()
print
(
"train tfrecord done"
)
print
((
h
-
f
)
/
60
)
...
...
@@ -258,7 +258,7 @@ def feature_engineer():
spark
.
createDataFrame
(
test
)
.
toDF
(
"y"
,
"z"
,
"app_list"
,
"level2_list"
,
"level3_list"
,
"tag1_list"
,
"tag2_list"
,
"tag3_list"
,
"tag4_list"
,
"tag5_list"
,
"tag6_list"
,
"tag7_list"
,
"ids"
,
"search_tag2
"
,
"search_tag3
"
)
\
"tag5_list"
,
"tag6_list"
,
"tag7_list"
,
"ids"
,
"search_tag2
_list"
,
"search_tag3_list
"
)
\
.
repartition
(
1
)
.
write
.
format
(
"tfrecords"
)
.
save
(
path
=
path
+
"va/"
,
mode
=
"overwrite"
)
print
(
"va tfrecord done"
)
...
...
This diff is collapsed.
Click to expand it.
tensnsorflow/train_tag.py
View file @
a530634f
...
...
@@ -133,8 +133,8 @@ def model_fn(features, labels, mode, params):
tag5_list
=
features
[
'tag5_list'
]
tag6_list
=
features
[
'tag6_list'
]
tag7_list
=
features
[
'tag7_list'
]
search_tag2_list
=
features
[
'search_tag2'
]
search_tag3_list
=
features
[
'search_tag3'
]
search_tag2_list
=
features
[
'search_tag2
_list
'
]
search_tag3_list
=
features
[
'search_tag3
_list
'
]
if
FLAGS
.
task_type
!=
"infer"
:
y
=
labels
[
'y'
]
...
...
@@ -320,7 +320,7 @@ def main(_):
FLAGS
.
model_dir
=
FLAGS
.
model_dir
+
FLAGS
.
dt_dir
#FLAGS.data_dir = FLAGS.data_dir + FLAGS.dt_dir
tr_files
=
[
"hdfs://172.16.32.4:8020/strategy/esmm/t
est_t
r/part-r-00000"
]
tr_files
=
[
"hdfs://172.16.32.4:8020/strategy/esmm/tr/part-r-00000"
]
va_files
=
[
"hdfs://172.16.32.4:8020/strategy/esmm/va/part-r-00000"
]
te_files
=
[
"
%
s/part-r-00000"
%
FLAGS
.
hdfs_dir
]
...
...
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