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
ea87dd88
Unverified
Commit
ea87dd88
authored
Dec 09, 2021
by
James Lamb
Committed by
GitHub
Dec 10, 2021
Browse files
[R-package] remove support for '...' in `lgb.Dataset()` (#4874)
parent
de08d149
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
21 deletions
+5
-21
R-package/R/lgb.Dataset.R
R-package/R/lgb.Dataset.R
+1
-16
R-package/man/lgb.Dataset.Rd
R-package/man/lgb.Dataset.Rd
+1
-4
R-package/tests/testthat/test_basic.R
R-package/tests/testthat/test_basic.R
+3
-1
No files found.
R-package/R/lgb.Dataset.R
View file @
ea87dd88
...
@@ -776,7 +776,6 @@ Dataset <- R6::R6Class(
...
@@ -776,7 +776,6 @@ Dataset <- R6::R6Class(
#' This reduces LightGBM's memory consumption, but it means that the Dataset object
#' This reduces LightGBM's memory consumption, but it means that the Dataset object
#' cannot be changed after it has been constructed. If you'd prefer to be able to
#' cannot be changed after it has been constructed. If you'd prefer to be able to
#' change the Dataset object after construction, set \code{free_raw_data = FALSE}.
#' change the Dataset object after construction, set \code{free_raw_data = FALSE}.
#' @param ... other parameters passed to \code{params}
#'
#'
#' @return constructed dataset
#' @return constructed dataset
#'
#'
...
@@ -800,22 +799,8 @@ lgb.Dataset <- function(data,
...
@@ -800,22 +799,8 @@ lgb.Dataset <- function(data,
label
=
NULL
,
label
=
NULL
,
weight
=
NULL
,
weight
=
NULL
,
group
=
NULL
,
group
=
NULL
,
init_score
=
NULL
,
init_score
=
NULL
)
{
...
)
{
additional_params
<-
list
(
...
)
params
<-
modifyList
(
params
,
additional_params
)
if
(
length
(
additional_params
)
>
0L
)
{
warning
(
paste0
(
"lgb.Dataset: Found the following passed through '...': "
,
paste
(
names
(
additional_params
),
collapse
=
", "
)
,
". These will be used, but in future releases of lightgbm, this warning will become an error. "
,
"Add these to 'params' instead. See ?lgb.Dataset for documentation on how to call this function."
))
}
# Create new dataset
return
(
return
(
invisible
(
Dataset
$
new
(
invisible
(
Dataset
$
new
(
data
=
data
data
=
data
...
...
R-package/man/lgb.Dataset.Rd
View file @
ea87dd88
...
@@ -14,8 +14,7 @@ lgb.Dataset(
...
@@ -14,8 +14,7 @@ lgb.Dataset(
label = NULL,
label = NULL,
weight = NULL,
weight = NULL,
group = NULL,
group = NULL,
init_score = NULL,
init_score = NULL
...
)
)
}
}
\arguments{
\arguments{
...
@@ -56,8 +55,6 @@ where the first 10 records are in the first group, records 11-30 are in the
...
@@ -56,8 +55,6 @@ where the first 10 records are in the first group, records 11-30 are in the
second group, etc.}
second group, etc.}
\item{init_score}{initial score is the base prediction lightgbm will boost from}
\item{init_score}{initial score is the base prediction lightgbm will boost from}
\item{...}{other parameters passed to \code{params}}
}
}
\value{
\value{
constructed dataset
constructed dataset
...
...
R-package/tests/testthat/test_basic.R
View file @
ea87dd88
...
@@ -2075,7 +2075,9 @@ test_that("lgb.train() works with linear learners and data where a feature has o
...
@@ -2075,7 +2075,9 @@ test_that("lgb.train() works with linear learners and data where a feature has o
return
(
lgb.Dataset
(
return
(
lgb.Dataset
(
data
=
X
data
=
X
,
label
=
2L
*
X
[,
1L
]
+
runif
(
nrow
(
X
),
0L
,
0.1
)
,
label
=
2L
*
X
[,
1L
]
+
runif
(
nrow
(
X
),
0L
,
0.1
)
,
feature_pre_filter
=
FALSE
,
params
=
list
(
feature_pre_filter
=
FALSE
)
))
))
}
}
...
...
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