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
9307d538
"vscode:/vscode.git/clone" did not exist on "5442aa97d71491cb738fa98c1d69a40760db593b"
Unverified
Commit
9307d538
authored
Mar 12, 2022
by
david-cortes
Committed by
GitHub
Mar 12, 2022
Browse files
[R-package] Rename `data` -> `newdata` in `predict()` (#4973)
parent
faccbb8e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
R-package/R/lgb.Booster.R
R-package/R/lgb.Booster.R
+4
-4
R-package/man/predict.lgb.Booster.Rd
R-package/man/predict.lgb.Booster.Rd
+2
-2
R-package/tests/testthat/test_Predictor.R
R-package/tests/testthat/test_Predictor.R
+1
-1
No files found.
R-package/R/lgb.Booster.R
View file @
9307d538
...
...
@@ -713,8 +713,8 @@ Booster <- R6::R6Class(
#' @title Predict method for LightGBM model
#' @description Predicted values based on class \code{lgb.Booster}
#' @param object Object of class \code{lgb.Booster}
#' @param data a \code{matrix} object, a \code{dgCMatrix} object or
#' a character representing a path to a text file (CSV, TSV, or LibSVM)
#' @param
new
data a \code{matrix} object, a \code{dgCMatrix} object or
#'
a character representing a path to a text file (CSV, TSV, or LibSVM)
#' @param start_iteration int or None, optional (default=None)
#' Start index of the iteration to predict.
#' If None or <= 0, starts from the first iteration.
...
...
@@ -779,7 +779,7 @@ Booster <- R6::R6Class(
#' @importFrom utils modifyList
#' @export
predict.lgb.Booster
<-
function
(
object
,
data
,
new
data
,
start_iteration
=
NULL
,
num_iteration
=
NULL
,
rawscore
=
FALSE
,
...
...
@@ -805,7 +805,7 @@ predict.lgb.Booster <- function(object,
return
(
object
$
predict
(
data
=
data
data
=
new
data
,
start_iteration
=
start_iteration
,
num_iteration
=
num_iteration
,
rawscore
=
rawscore
...
...
R-package/man/predict.lgb.Booster.Rd
View file @
9307d538
...
...
@@ -6,7 +6,7 @@
\
usage
{
\
method
{
predict
}{
lgb
.
Booster
}(
object
,
data
,
new
data
,
start_iteration
=
NULL
,
num_iteration
=
NULL
,
rawscore
=
FALSE
,
...
...
@@ -21,7 +21,7 @@
\
arguments
{
\
item
{
object
}{
Object
of
class
\
code
{
lgb
.
Booster
}}
\
item
{
data
}{
a
\
code
{
matrix
}
object
,
a
\
code
{
dgCMatrix
}
object
or
\
item
{
new
data
}{
a
\
code
{
matrix
}
object
,
a
\
code
{
dgCMatrix
}
object
or
a
character
representing
a
path
to
a
text
file
(
CSV
,
TSV
,
or
LibSVM
)}
\
item
{
start_iteration
}{
int
or
None
,
optional
(
default
=
None
)
...
...
R-package/tests/testthat/test_Predictor.R
View file @
9307d538
...
...
@@ -79,7 +79,7 @@ test_that("start_iteration works correctly", {
,
early_stopping_rounds
=
2L
)
expect_true
(
lgb.is.Booster
(
bst
))
pred1
<-
predict
(
bst
,
data
=
test
$
data
,
rawscore
=
TRUE
)
pred1
<-
predict
(
bst
,
new
data
=
test
$
data
,
rawscore
=
TRUE
)
pred_contrib1
<-
predict
(
bst
,
test
$
data
,
predcontrib
=
TRUE
)
pred2
<-
rep
(
0.0
,
length
(
pred1
))
pred_contrib2
<-
rep
(
0.0
,
length
(
pred2
))
...
...
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