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
85b28439
Unverified
Commit
85b28439
authored
Jun 22, 2020
by
James Lamb
Committed by
GitHub
Jun 23, 2020
Browse files
[R-package] [ci] cut nrounds in unit tests (#3169)
parent
fa2de89b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
6 deletions
+7
-6
R-package/tests/testthat/test_Predictor.R
R-package/tests/testthat/test_Predictor.R
+1
-0
R-package/tests/testthat/test_lgb.interprete.R
R-package/tests/testthat/test_lgb.interprete.R
+2
-2
R-package/tests/testthat/test_lgb.plot.importance.R
R-package/tests/testthat/test_lgb.plot.importance.R
+1
-1
R-package/tests/testthat/test_lgb.plot.interpretation.R
R-package/tests/testthat/test_lgb.plot.interpretation.R
+2
-2
R-package/tests/testthat/test_parameters.R
R-package/tests/testthat/test_parameters.R
+1
-1
No files found.
R-package/tests/testthat/test_Predictor.R
View file @
85b28439
...
@@ -8,6 +8,7 @@ test_that("predictions do not fail for integer input", {
...
@@ -8,6 +8,7 @@ test_that("predictions do not fail for integer input", {
data
=
dtrain
data
=
dtrain
,
objective
=
"regression"
,
objective
=
"regression"
,
verbose
=
-1L
,
verbose
=
-1L
,
nrounds
=
3L
)
)
X_double
<-
X
[
c
(
1L
,
51L
,
101L
),
,
drop
=
FALSE
]
X_double
<-
X
[
c
(
1L
,
51L
,
101L
),
,
drop
=
FALSE
]
X_integer
<-
X_double
X_integer
<-
X_double
...
...
R-package/tests/testthat/test_lgb.interprete.R
View file @
85b28439
...
@@ -32,7 +32,7 @@ test_that("lgb.intereprete works as expected for binary classification", {
...
@@ -32,7 +32,7 @@ test_that("lgb.intereprete works as expected for binary classification", {
model
<-
lgb.train
(
model
<-
lgb.train
(
params
=
params
params
=
params
,
data
=
dtrain
,
data
=
dtrain
,
nrounds
=
10
L
,
nrounds
=
3
L
)
)
num_trees
<-
5L
num_trees
<-
5L
tree_interpretation
<-
lgb.interprete
(
tree_interpretation
<-
lgb.interprete
(
...
@@ -82,7 +82,7 @@ test_that("lgb.intereprete works as expected for multiclass classification", {
...
@@ -82,7 +82,7 @@ test_that("lgb.intereprete works as expected for multiclass classification", {
model
<-
lgb.train
(
model
<-
lgb.train
(
params
=
params
params
=
params
,
data
=
dtrain
,
data
=
dtrain
,
nrounds
=
10
L
,
nrounds
=
3
L
,
min_data
=
1L
,
min_data
=
1L
)
)
num_trees
<-
5L
num_trees
<-
5L
...
...
R-package/tests/testthat/test_lgb.plot.importance.R
View file @
85b28439
...
@@ -12,7 +12,7 @@ test_that("lgb.plot.importance() should run without error for well-formed inputs
...
@@ -12,7 +12,7 @@ test_that("lgb.plot.importance() should run without error for well-formed inputs
,
min_data_in_leaf
=
1L
,
min_data_in_leaf
=
1L
,
min_sum_hessian_in_leaf
=
1.0
,
min_sum_hessian_in_leaf
=
1.0
)
)
model
<-
lgb.train
(
params
,
dtrain
,
10
L
)
model
<-
lgb.train
(
params
,
dtrain
,
3
L
)
tree_imp
<-
lgb.importance
(
model
,
percentage
=
TRUE
)
tree_imp
<-
lgb.importance
(
model
,
percentage
=
TRUE
)
# Check that there are no plots present before plotting
# Check that there are no plots present before plotting
...
...
R-package/tests/testthat/test_lgb.plot.interpretation.R
View file @
85b28439
...
@@ -32,7 +32,7 @@ test_that("lgb.plot.interepretation works as expected for binary classification"
...
@@ -32,7 +32,7 @@ test_that("lgb.plot.interepretation works as expected for binary classification"
model
<-
lgb.train
(
model
<-
lgb.train
(
params
=
params
params
=
params
,
data
=
dtrain
,
data
=
dtrain
,
nrounds
=
10
L
,
nrounds
=
3
L
)
)
num_trees
<-
5L
num_trees
<-
5L
tree_interpretation
<-
lgb.interprete
(
tree_interpretation
<-
lgb.interprete
(
...
@@ -80,7 +80,7 @@ test_that("lgb.plot.interepretation works as expected for multiclass classificat
...
@@ -80,7 +80,7 @@ test_that("lgb.plot.interepretation works as expected for multiclass classificat
model
<-
lgb.train
(
model
<-
lgb.train
(
params
=
params
params
=
params
,
data
=
dtrain
,
data
=
dtrain
,
nrounds
=
10
L
,
nrounds
=
3
L
,
min_data
=
1L
,
min_data
=
1L
)
)
num_trees
<-
5L
num_trees
<-
5L
...
...
R-package/tests/testthat/test_parameters.R
View file @
85b28439
...
@@ -19,7 +19,7 @@ test_that("Feature penalties work properly", {
...
@@ -19,7 +19,7 @@ test_that("Feature penalties work properly", {
,
label
=
train
$
label
,
label
=
train
$
label
,
num_leaves
=
5L
,
num_leaves
=
5L
,
learning_rate
=
0.05
,
learning_rate
=
0.05
,
nrounds
=
20
L
,
nrounds
=
5
L
,
objective
=
"binary"
,
objective
=
"binary"
,
feature_penalty
=
paste0
(
feature_penalties
,
collapse
=
","
)
,
feature_penalty
=
paste0
(
feature_penalties
,
collapse
=
","
)
,
metric
=
"binary_error"
,
metric
=
"binary_error"
...
...
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