Unverified Commit 7e2f353d authored by Anshu Trivedi's avatar Anshu Trivedi Committed by GitHub
Browse files

[R-package] Updated lgb.train.R with keyword arguments (#3464)


Co-authored-by: default avatarJames Lamb <jaylamb20@gmail.com>
parent 81d76113
...@@ -15,7 +15,7 @@ Predictor <- R6::R6Class( ...@@ -15,7 +15,7 @@ Predictor <- R6::R6Class(
# Freeing up handle # Freeing up handle
lgb.call( lgb.call(
"LGBM_BoosterFree_R" fun_name = "LGBM_BoosterFree_R"
, ret = NULL , ret = NULL
, private$handle , private$handle
) )
...@@ -37,7 +37,7 @@ Predictor <- R6::R6Class( ...@@ -37,7 +37,7 @@ Predictor <- R6::R6Class(
# Create handle on it # Create handle on it
handle <- lgb.call( handle <- lgb.call(
"LGBM_BoosterCreateFromModelfile_R" fun_name = "LGBM_BoosterCreateFromModelfile_R"
, ret = handle , ret = handle
, lgb.c_str(modelfile) , lgb.c_str(modelfile)
) )
...@@ -66,7 +66,7 @@ Predictor <- R6::R6Class( ...@@ -66,7 +66,7 @@ Predictor <- R6::R6Class(
cur_iter <- 0L cur_iter <- 0L
lgb.call( lgb.call(
"LGBM_BoosterGetCurrentIteration_R" fun_name = "LGBM_BoosterGetCurrentIteration_R"
, ret = cur_iter , ret = cur_iter
, private$handle , private$handle
) )
...@@ -103,7 +103,7 @@ Predictor <- R6::R6Class( ...@@ -103,7 +103,7 @@ Predictor <- R6::R6Class(
# Predict from temporary file # Predict from temporary file
lgb.call( lgb.call(
"LGBM_BoosterPredictForFile_R" fun_name = "LGBM_BoosterPredictForFile_R"
, ret = NULL , ret = NULL
, private$handle , private$handle
, data , data
...@@ -131,7 +131,7 @@ Predictor <- R6::R6Class( ...@@ -131,7 +131,7 @@ Predictor <- R6::R6Class(
# Check number of predictions to do # Check number of predictions to do
npred <- lgb.call( npred <- lgb.call(
"LGBM_BoosterCalcNumPredict_R" fun_name = "LGBM_BoosterCalcNumPredict_R"
, ret = npred , ret = npred
, private$handle , private$handle
, as.integer(num_row) , as.integer(num_row)
...@@ -153,7 +153,7 @@ Predictor <- R6::R6Class( ...@@ -153,7 +153,7 @@ Predictor <- R6::R6Class(
storage.mode(data) <- "double" storage.mode(data) <- "double"
} }
preds <- lgb.call( preds <- lgb.call(
"LGBM_BoosterPredictForMat_R" fun_name = "LGBM_BoosterPredictForMat_R"
, ret = preds , ret = preds
, private$handle , private$handle
, data , data
...@@ -173,7 +173,7 @@ Predictor <- R6::R6Class( ...@@ -173,7 +173,7 @@ Predictor <- R6::R6Class(
} }
# Check if data is a dgCMatrix (sparse matrix, column compressed format) # Check if data is a dgCMatrix (sparse matrix, column compressed format)
preds <- lgb.call( preds <- lgb.call(
"LGBM_BoosterPredictForCSC_R" fun_name = "LGBM_BoosterPredictForCSC_R"
, ret = preds , ret = preds
, private$handle , private$handle
, data@p , data@p
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment