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
962d604e
Commit
962d604e
authored
Mar 26, 2019
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复生成tfrecord文件时的bug
parent
fac49e8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
feature.py
tensnsorflow/es/feature.py
+4
-1
to_tfrecord.py
tensnsorflow/es/to_tfrecord.py
+2
-2
No files found.
tensnsorflow/es/feature.py
View file @
962d604e
...
...
@@ -110,7 +110,10 @@ def app_list_func(x,l):
b
=
x
.
split
(
","
)
e
=
[]
for
i
in
b
:
e
.
append
(
l
[
i
])
if
i
in
l
.
keys
:
e
.
append
(
l
[
i
])
else
:
e
.
append
(
0
)
return
","
.
join
([
str
(
j
)
for
j
in
e
])
...
...
tensnsorflow/es/to_tfrecord.py
View file @
962d604e
...
...
@@ -33,8 +33,8 @@ def gen_tfrecords(in_file):
id
=
np
.
array
([])
for
j
in
feats
:
id
=
np
.
append
(
id
,
df
[
j
][
i
])
app_list
=
np
.
array
(
df
[
"app_list"
][
i
]
.
split
(
","
))
level2_list
=
np
.
array
(
df
[
"clevel2_id"
][
i
]
.
split
(
","
))
app_list
=
np
.
array
(
str
(
df
[
"app_list"
][
i
])
.
split
(
","
))
level2_list
=
np
.
array
(
str
(
df
[
"clevel2_id"
][
i
])
.
split
(
","
))
features
=
tf
.
train
.
Features
(
feature
=
{
"y"
:
tf
.
train
.
Feature
(
float_list
=
tf
.
train
.
FloatList
(
value
=
[
df
[
"y"
][
i
]])),
"z"
:
tf
.
train
.
Feature
(
float_list
=
tf
.
train
.
FloatList
(
value
=
[
df
[
"z"
][
i
]])),
...
...
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