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
a5f11d47
Commit
a5f11d47
authored
Apr 13, 2017
by
Huan Zhang
Committed by
Guolin Ke
Apr 13, 2017
Browse files
Use only one thread in test_basic.py (#412)
parent
ab559101
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
tests/python_package_test/test_basic.py
tests/python_package_test/test_basic.py
+3
-1
No files found.
tests/python_package_test/test_basic.py
View file @
a5f11d47
...
@@ -22,7 +22,8 @@ class TestBasic(unittest.TestCase):
...
@@ -22,7 +22,8 @@ class TestBasic(unittest.TestCase):
"metric"
:
"auc"
,
"metric"
:
"auc"
,
"min_data"
:
10
,
"min_data"
:
10
,
"num_leaves"
:
15
,
"num_leaves"
:
15
,
"verbose"
:
-
1
"verbose"
:
-
1
,
"num_threads"
:
1
}
}
bst
=
lgb
.
Booster
(
params
,
train_data
)
bst
=
lgb
.
Booster
(
params
,
train_data
)
bst
.
add_valid
(
valid_data
,
"valid_1"
)
bst
.
add_valid
(
valid_data
,
"valid_1"
)
...
@@ -47,6 +48,7 @@ class TestBasic(unittest.TestCase):
...
@@ -47,6 +48,7 @@ class TestBasic(unittest.TestCase):
pred_from_model_file
=
bst
.
predict
(
X_test
)
pred_from_model_file
=
bst
.
predict
(
X_test
)
self
.
assertEqual
(
len
(
pred_from_matr
),
len
(
pred_from_model_file
))
self
.
assertEqual
(
len
(
pred_from_matr
),
len
(
pred_from_model_file
))
for
preds
in
zip
(
pred_from_matr
,
pred_from_model_file
):
for
preds
in
zip
(
pred_from_matr
,
pred_from_model_file
):
# we need to check the consistency of model file here, so test for exact equal
self
.
assertEqual
(
*
preds
)
self
.
assertEqual
(
*
preds
)
# check pmml
# check pmml
os
.
system
(
'python ../../pmml/pmml.py model.txt'
)
os
.
system
(
'python ../../pmml/pmml.py model.txt'
)
...
...
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