Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R-package] Updated lgb.Predictor.R with keyword arguments #3464

Merged
merged 2 commits into from
Oct 18, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions R-package/R/lgb.Predictor.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Predictor <- R6::R6Class(

# Freeing up handle
lgb.call(
"LGBM_BoosterFree_R"
fun_name = "LGBM_BoosterFree_R"
, ret = NULL
, private$handle
)
Expand All @@ -37,7 +37,7 @@ Predictor <- R6::R6Class(

# Create handle on it
handle <- lgb.call(
"LGBM_BoosterCreateFromModelfile_R"
fun_name = "LGBM_BoosterCreateFromModelfile_R"
, ret = handle
, lgb.c_str(modelfile)
)
Expand Down Expand Up @@ -66,7 +66,7 @@ Predictor <- R6::R6Class(

cur_iter <- 0L
lgb.call(
"LGBM_BoosterGetCurrentIteration_R"
fun_name = "LGBM_BoosterGetCurrentIteration_R"
, ret = cur_iter
, private$handle
)
Expand Down Expand Up @@ -103,7 +103,7 @@ Predictor <- R6::R6Class(

# Predict from temporary file
lgb.call(
"LGBM_BoosterPredictForFile_R"
fun_name = "LGBM_BoosterPredictForFile_R"
, ret = NULL
, private$handle
, data
Expand Down Expand Up @@ -131,7 +131,7 @@ Predictor <- R6::R6Class(

# Check number of predictions to do
npred <- lgb.call(
"LGBM_BoosterCalcNumPredict_R"
fun_name = "LGBM_BoosterCalcNumPredict_R"
, ret = npred
, private$handle
, as.integer(num_row)
Expand All @@ -153,7 +153,7 @@ Predictor <- R6::R6Class(
storage.mode(data) <- "double"
}
preds <- lgb.call(
"LGBM_BoosterPredictForMat_R"
fun_name = "LGBM_BoosterPredictForMat_R"
, ret = preds
, private$handle
, data
Expand All @@ -173,7 +173,7 @@ Predictor <- R6::R6Class(
}
# Check if data is a dgCMatrix (sparse matrix, column compressed format)
preds <- lgb.call(
"LGBM_BoosterPredictForCSC_R"
fun_name = "LGBM_BoosterPredictForCSC_R"
, ret = preds
, private$handle
, data@p
Expand Down