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
cf4edf0e
"git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "a178b75b676735a1ec300cf82eba2b31a50cf8bc"
Commit
cf4edf0e
authored
Jan 04, 2017
by
Guolin Ke
Browse files
add test for check model file persistence
parent
dcbdc675
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
tests/python_package_test/test_basic.py
tests/python_package_test/test_basic.py
+7
-1
No files found.
tests/python_package_test/test_basic.py
View file @
cf4edf0e
...
...
@@ -37,7 +37,13 @@ class TestBasic(unittest.TestCase):
os
.
remove
(
tname
)
self
.
assertEqual
(
len
(
pred_from_matr
),
len
(
pred_from_file
))
for
preds
in
zip
(
pred_from_matr
,
pred_from_file
):
self
.
assertAlmostEqual
(
*
preds
,
places
=
5
)
self
.
assertAlmostEqual
(
*
preds
,
places
=
15
)
#check saved model persistence
bst
=
lgb
.
Booster
(
params
,
model_file
=
"model.txt"
)
pred_from_model_file
=
bst
.
predict
(
X_test
)
self
.
assertEqual
(
len
(
pred_from_matr
),
len
(
pred_from_model_file
))
for
preds
in
zip
(
pred_from_matr
,
pred_from_model_file
):
self
.
assertAlmostEqual
(
*
preds
,
places
=
15
)
print
(
"----------------------------------------------------------------------"
)
print
(
"running test_basic.py"
)
...
...
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