Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
3a8b5e5f
Commit
3a8b5e5f
authored
Apr 13, 2017
by
Guolin Ke
Browse files
fix pmml.py
parent
a5f11d47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
pmml/pmml.py
pmml/pmml.py
+4
-0
No files found.
pmml/pmml.py
View file @
3a8b5e5f
...
...
@@ -87,6 +87,8 @@ with open(argv[1], 'r') as model_in:
model_content
=
iter
([
line
for
line
in
model_in
.
read
().
splitlines
()
if
line
][
6
:])
feature_names
=
get_array_strings
(
next
(
model_content
))
feature_infos
=
get_array_strings
(
next
(
model_content
))
segment_id
=
count
(
1
)
with
open
(
'LightGBM_pmml.xml'
,
'w'
)
as
pmml_out
:
...
...
@@ -136,6 +138,8 @@ with open('LightGBM_pmml.xml', 'w') as pmml_out:
leaf_count
=
get_array_strings
(
next
(
model_content
))
internal_value
=
get_array_strings
(
next
(
model_content
))
internal_count
=
get_array_strings
(
next
(
model_content
))
shrinkage
=
get_value_string
(
next
(
model_content
))
has_categorical
=
get_value_string
(
next
(
model_content
))
unique_id
=
count
(
1
)
print_pmml
()
out_
(
"
\t\t\t
</Segment>"
)
...
...
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