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
5014f19f
Unverified
Commit
5014f19f
authored
Apr 26, 2021
by
James Lamb
Committed by
GitHub
Apr 26, 2021
Browse files
[R-package] fix warnings in unit tests (#4225)
parent
b6c71e5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
R-package/tests/testthat/test_basic.R
R-package/tests/testthat/test_basic.R
+6
-11
No files found.
R-package/tests/testthat/test_basic.R
View file @
5014f19f
...
@@ -1582,9 +1582,6 @@ test_that("If first_metric_only is TRUE, lgb.cv() decides to stop early based on
...
@@ -1582,9 +1582,6 @@ test_that("If first_metric_only is TRUE, lgb.cv() decides to stop early based on
,
data
=
DTRAIN_RANDOM_REGRESSION
,
data
=
DTRAIN_RANDOM_REGRESSION
,
nfold
=
nfolds
,
nfold
=
nfolds
,
nrounds
=
nrounds
,
nrounds
=
nrounds
,
valids
=
list
(
"valid1"
=
DVALID_RANDOM_REGRESSION
)
,
eval
=
list
(
,
eval
=
list
(
.increasing_metric
.increasing_metric
,
.constant_metric
,
.constant_metric
...
@@ -1641,9 +1638,6 @@ test_that("early stopping works with lgb.cv()", {
...
@@ -1641,9 +1638,6 @@ test_that("early stopping works with lgb.cv()", {
,
data
=
DTRAIN_RANDOM_REGRESSION
,
data
=
DTRAIN_RANDOM_REGRESSION
,
nfold
=
nfolds
,
nfold
=
nfolds
,
nrounds
=
nrounds
,
nrounds
=
nrounds
,
valids
=
list
(
"valid1"
=
DVALID_RANDOM_REGRESSION
)
,
eval
=
list
(
,
eval
=
list
(
.constant_metric
.constant_metric
,
.increasing_metric
,
.increasing_metric
...
@@ -1841,15 +1835,16 @@ test_that("lgb.train() works with linear learners, bagging, and a Dataset that h
...
@@ -1841,15 +1835,16 @@ test_that("lgb.train() works with linear learners, bagging, and a Dataset that h
test_that
(
"lgb.train() works with linear learners and data where a feature has only 1 non-NA value"
,
{
test_that
(
"lgb.train() works with linear learners and data where a feature has only 1 non-NA value"
,
{
set.seed
(
708L
)
set.seed
(
708L
)
.new_dataset
<-
function
()
{
.new_dataset
<-
function
()
{
values
<-
rep
(
NA_real_
,
100L
)
values
<-
c
(
rnorm
(
100L
),
rep
(
NA_real_
,
100L
)
)
values
[
18L
]
<-
rnorm
(
1L
)
values
[
1
18L
]
<-
rnorm
(
1L
)
X
<-
matrix
(
X
<-
matrix
(
data
=
values
data
=
values
,
ncol
=
1
L
,
ncol
=
2
L
)
)
return
(
lgb.Dataset
(
return
(
lgb.Dataset
(
data
=
X
data
=
X
,
label
=
2L
*
X
+
runif
(
nrow
(
X
),
0L
,
0.1
)
,
label
=
2L
*
X
[,
1L
]
+
runif
(
nrow
(
X
),
0L
,
0.1
)
,
feature_pre_filter
=
FALSE
))
))
}
}
...
@@ -1888,7 +1883,7 @@ test_that("lgb.train() works with linear learners when Dataset has categorical f
...
@@ -1888,7 +1883,7 @@ test_that("lgb.train() works with linear learners when Dataset has categorical f
,
metric
=
"mse"
,
metric
=
"mse"
,
seed
=
0L
,
seed
=
0L
,
num_leaves
=
2L
,
num_leaves
=
2L
,
categorical_feature
s
=
1L
,
categorical_feature
=
1L
)
)
dtrain
<-
.new_dataset
()
dtrain
<-
.new_dataset
()
...
...
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