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
7fa4432b
Unverified
Commit
7fa4432b
authored
Oct 08, 2022
by
James Lamb
Committed by
GitHub
Oct 08, 2022
Browse files
[R-package] fix test on non-ASCII features in non-UTF8 locales (#5526)
parent
fb7f5eac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
R-package/tests/testthat/test_basic.R
R-package/tests/testthat/test_basic.R
+12
-1
No files found.
R-package/tests/testthat/test_basic.R
View file @
7fa4432b
...
...
@@ -1719,7 +1719,18 @@ test_that("lgb.train() supports non-ASCII feature names", {
data
=
matrix
(
rnorm
(
400L
),
ncol
=
4L
)
,
label
=
rnorm
(
100L
)
)
feature_names
<-
c
(
"F_零"
,
"F_一"
,
"F_二"
,
"F_三"
)
# content below is equivalent to
#
# feature_names <- c("F_零", "F_一", "F_二", "F_三")
#
# but using rawToChar() to avoid weird issues when {testthat}
# sources files and converts their encodings prior to evaluating the code
feature_names
<-
c
(
rawToChar
(
as.raw
(
c
(
0x46
,
0x5f
,
0xe9
,
0x9b
,
0xb6
)))
,
rawToChar
(
as.raw
(
c
(
0x46
,
0x5f
,
0xe4
,
0xb8
,
0x80
)))
,
rawToChar
(
as.raw
(
c
(
0x46
,
0x5f
,
0xe4
,
0xba
,
0x8c
)))
,
rawToChar
(
as.raw
(
c
(
0x46
,
0x5f
,
0xe4
,
0xb8
,
0x89
)))
)
bst
<-
lgb.train
(
data
=
dtrain
,
nrounds
=
5L
...
...
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