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
e02ddc44
Unverified
Commit
e02ddc44
authored
Aug 31, 2022
by
James Lamb
Committed by
GitHub
Aug 31, 2022
Browse files
[R-package] fix function references in error messages (#5455)
parent
9e89ee7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
R-package/R/lgb.Booster.R
R-package/R/lgb.Booster.R
+1
-1
R-package/R/lgb.Dataset.R
R-package/R/lgb.Dataset.R
+4
-4
No files found.
R-package/R/lgb.Booster.R
View file @
e02ddc44
...
@@ -1319,7 +1319,7 @@ lgb.save <- function(booster, filename, num_iteration = NULL) {
...
@@ -1319,7 +1319,7 @@ lgb.save <- function(booster, filename, num_iteration = NULL) {
lgb.dump
<-
function
(
booster
,
num_iteration
=
NULL
)
{
lgb.dump
<-
function
(
booster
,
num_iteration
=
NULL
)
{
if
(
!
lgb.is.Booster
(
x
=
booster
))
{
if
(
!
lgb.is.Booster
(
x
=
booster
))
{
stop
(
"lgb.
save
: booster should be an "
,
sQuote
(
"lgb.Booster"
))
stop
(
"lgb.
dump
: booster should be an "
,
sQuote
(
"lgb.Booster"
))
}
}
# Return booster at requested iteration
# Return booster at requested iteration
...
...
R-package/R/lgb.Dataset.R
View file @
e02ddc44
...
@@ -161,7 +161,7 @@ Dataset <- R6::R6Class(
...
@@ -161,7 +161,7 @@ Dataset <- R6::R6Class(
# Provided indices, but some indices are missing?
# Provided indices, but some indices are missing?
if
(
sum
(
is.na
(
cate_indices
))
>
0L
)
{
if
(
sum
(
is.na
(
cate_indices
))
>
0L
)
{
stop
(
stop
(
"lgb.
self.get.handle
: supplied an unknown feature in categorical_feature: "
"lgb.
Dataset.construct
: supplied an unknown feature in categorical_feature: "
,
sQuote
(
private
$
categorical_feature
[
is.na
(
cate_indices
)])
,
sQuote
(
private
$
categorical_feature
[
is.na
(
cate_indices
)])
)
)
}
}
...
@@ -172,7 +172,7 @@ Dataset <- R6::R6Class(
...
@@ -172,7 +172,7 @@ Dataset <- R6::R6Class(
data_is_not_filename
<-
!
is.character
(
private
$
raw_data
)
data_is_not_filename
<-
!
is.character
(
private
$
raw_data
)
if
(
data_is_not_filename
&&
max
(
private
$
categorical_feature
)
>
ncol
(
private
$
raw_data
))
{
if
(
data_is_not_filename
&&
max
(
private
$
categorical_feature
)
>
ncol
(
private
$
raw_data
))
{
stop
(
stop
(
"lgb.
self.get.handle
: supplied a too large value in categorical_feature: "
"lgb.
Dataset.construct
: supplied a too large value in categorical_feature: "
,
max
(
private
$
categorical_feature
)
,
max
(
private
$
categorical_feature
)
,
" but only "
,
" but only "
,
ncol
(
private
$
raw_data
)
,
ncol
(
private
$
raw_data
)
...
@@ -1250,11 +1250,11 @@ lgb.Dataset.set.reference <- function(dataset, reference) {
...
@@ -1250,11 +1250,11 @@ lgb.Dataset.set.reference <- function(dataset, reference) {
lgb.Dataset.save
<-
function
(
dataset
,
fname
)
{
lgb.Dataset.save
<-
function
(
dataset
,
fname
)
{
if
(
!
lgb.is.Dataset
(
x
=
dataset
))
{
if
(
!
lgb.is.Dataset
(
x
=
dataset
))
{
stop
(
"lgb.Dataset.se
t
: input dataset should be an lgb.Dataset object"
)
stop
(
"lgb.Dataset.s
av
e: input dataset should be an lgb.Dataset object"
)
}
}
if
(
!
is.character
(
fname
))
{
if
(
!
is.character
(
fname
))
{
stop
(
"lgb.Dataset.se
t
: fname should be a character or a file connection"
)
stop
(
"lgb.Dataset.s
av
e: fname should be a character or a file connection"
)
}
}
return
(
invisible
(
dataset
$
save_binary
(
fname
=
fname
)))
return
(
invisible
(
dataset
$
save_binary
(
fname
=
fname
)))
...
...
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