lightgbm_R.h 15.2 KB
Newer Older
1
2
3
4
/*!
 * Copyright (c) 2017 Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See LICENSE file in the project root for license information.
 */
Guolin Ke's avatar
Guolin Ke committed
5
6
7
8
#ifndef LIGHTGBM_R_H_
#define LIGHTGBM_R_H_

#include <LightGBM/c_api.h>
9
10
11
12
13

#define R_NO_REMAP
#define R_USE_C99_IN_CXX
#include <Rinternals.h>

14
#include "R_object_helper.h"
Guolin Ke's avatar
Guolin Ke committed
15
16
17

/*!
* \brief get string message of the last error
18
*  all functions in this file will return 0 on success
19
20
21
*  and -1 when an error occurred
* \return err_msg error information
* \return error information
Guolin Ke's avatar
Guolin Ke committed
22
*/
23
LIGHTGBM_C_EXPORT SEXP LGBM_GetLastError_R();
Guolin Ke's avatar
Guolin Ke committed
24
25
26
27

// --- start Dataset interface

/*!
28
* \brief load data set from file like the command_line LightGBM does
Guolin Ke's avatar
Guolin Ke committed
29
30
* \param filename the name of the file
* \param parameters additional parameters
31
* \param reference used to align bin mapper with other dataset, nullptr means not used
Guolin Ke's avatar
Guolin Ke committed
32
33
34
* \param out created dataset
* \return 0 when succeed, -1 when failure happens
*/
35
LIGHTGBM_C_EXPORT SEXP LGBM_DatasetCreateFromFile_R(
36
  LGBM_SE filename,
Guolin Ke's avatar
Guolin Ke committed
37
38
  LGBM_SE parameters,
  LGBM_SE reference,
39
  LGBM_SE out
40
);
Guolin Ke's avatar
Guolin Ke committed
41
42
43
44
45
46

/*!
* \brief create a dataset from CSC format
* \param indptr pointer to row headers
* \param indices findex
* \param data fvalue
47
* \param num_indptr number of cols in the matrix + 1
Guolin Ke's avatar
Guolin Ke committed
48
49
50
* \param nelem number of nonzero elements in the matrix
* \param num_row number of rows
* \param parameters additional parameters
51
* \param reference used to align bin mapper with other dataset, nullptr means not used
Guolin Ke's avatar
Guolin Ke committed
52
53
54
* \param out created dataset
* \return 0 when succeed, -1 when failure happens
*/
55
LIGHTGBM_C_EXPORT SEXP LGBM_DatasetCreateFromCSC_R(
56
  LGBM_SE indptr,
Guolin Ke's avatar
Guolin Ke committed
57
58
  LGBM_SE indices,
  LGBM_SE data,
59
60
61
  SEXP num_indptr,
  SEXP nelem,
  SEXP num_row,
Guolin Ke's avatar
Guolin Ke committed
62
63
  LGBM_SE parameters,
  LGBM_SE reference,
64
  LGBM_SE out
65
);
Guolin Ke's avatar
Guolin Ke committed
66
67
68
69

/*!
* \brief create dataset from dense matrix
* \param data matric data
70
71
* \param num_row number of rows
* \param num_col number columns
Guolin Ke's avatar
Guolin Ke committed
72
* \param parameters additional parameters
73
* \param reference used to align bin mapper with other dataset, nullptr means not used
Guolin Ke's avatar
Guolin Ke committed
74
75
76
* \param out created dataset
* \return 0 when succeed, -1 when failure happens
*/
77
LIGHTGBM_C_EXPORT SEXP LGBM_DatasetCreateFromMat_R(
78
  LGBM_SE data,
79
80
  SEXP num_row,
  SEXP num_col,
Guolin Ke's avatar
Guolin Ke committed
81
82
  LGBM_SE parameters,
  LGBM_SE reference,
83
  LGBM_SE out
84
);
Guolin Ke's avatar
Guolin Ke committed
85
86
87
88
89
90
91
92
93
94

/*!
* \brief Create subset of a data
* \param handle handle of full dataset
* \param used_row_indices Indices used in subset
* \param len_used_row_indices length of Indices used in subset
* \param parameters additional parameters
* \param out created dataset
* \return 0 when succeed, -1 when failure happens
*/
95
LIGHTGBM_C_EXPORT SEXP LGBM_DatasetGetSubset_R(
96
  LGBM_SE handle,
Guolin Ke's avatar
Guolin Ke committed
97
  LGBM_SE used_row_indices,
98
  SEXP len_used_row_indices,
Guolin Ke's avatar
Guolin Ke committed
99
  LGBM_SE parameters,
100
  LGBM_SE out
101
);
Guolin Ke's avatar
Guolin Ke committed
102
103
104
105
106
107
108

/*!
* \brief save feature names to Dataset
* \param handle handle
* \param feature_names feature names
* \return 0 when succeed, -1 when failure happens
*/
109
LIGHTGBM_C_EXPORT SEXP LGBM_DatasetSetFeatureNames_R(
110
  LGBM_SE handle,
111
  LGBM_SE feature_names
112
);
Guolin Ke's avatar
Guolin Ke committed
113
114
115
116
117
118
119

/*!
* \brief save feature names to Dataset
* \param handle handle
* \param feature_names feature names
* \return 0 when succeed, -1 when failure happens
*/
120
LIGHTGBM_C_EXPORT SEXP LGBM_DatasetGetFeatureNames_R(
121
  LGBM_SE handle,
122
  SEXP buf_len,
Guolin Ke's avatar
Guolin Ke committed
123
  LGBM_SE actual_len,
124
  LGBM_SE feature_names
125
);
Guolin Ke's avatar
Guolin Ke committed
126
127

/*!
128
* \brief save dataset to binary file
129
* \param handle an instance of dataset
Guolin Ke's avatar
Guolin Ke committed
130
131
132
* \param filename file name
* \return 0 when succeed, -1 when failure happens
*/
133
LIGHTGBM_C_EXPORT SEXP LGBM_DatasetSaveBinary_R(
134
  LGBM_SE handle,
135
  LGBM_SE filename
136
);
Guolin Ke's avatar
Guolin Ke committed
137
138
139

/*!
* \brief free dataset
140
* \param handle an instance of dataset
Guolin Ke's avatar
Guolin Ke committed
141
142
* \return 0 when succeed, -1 when failure happens
*/
143
144
LIGHTGBM_C_EXPORT SEXP LGBM_DatasetFree_R(
  LGBM_SE handle
145
);
Guolin Ke's avatar
Guolin Ke committed
146
147
148

/*!
* \brief set vector to a content in info
149
*        Note: group and group_id only work for C_API_DTYPE_INT32
Guolin Ke's avatar
Guolin Ke committed
150
*              label and weight only work for C_API_DTYPE_FLOAT32
151
* \param handle an instance of dataset
Guolin Ke's avatar
Guolin Ke committed
152
153
154
155
156
* \param field_name field name, can be label, weight, group, group_id
* \param field_data pointer to vector
* \param num_element number of element in field_data
* \return 0 when succeed, -1 when failure happens
*/
157
LIGHTGBM_C_EXPORT SEXP LGBM_DatasetSetField_R(
158
  LGBM_SE handle,
Guolin Ke's avatar
Guolin Ke committed
159
160
  LGBM_SE field_name,
  LGBM_SE field_data,
161
  SEXP num_element
162
);
Guolin Ke's avatar
Guolin Ke committed
163
164
165

/*!
* \brief get size of info vector from dataset
166
* \param handle an instance of dataset
Guolin Ke's avatar
Guolin Ke committed
167
168
169
170
* \param field_name field name
* \param out size of info vector from dataset
* \return 0 when succeed, -1 when failure happens
*/
171
LIGHTGBM_C_EXPORT SEXP LGBM_DatasetGetFieldSize_R(
172
  LGBM_SE handle,
Guolin Ke's avatar
Guolin Ke committed
173
  LGBM_SE field_name,
174
  LGBM_SE out
175
);
Guolin Ke's avatar
Guolin Ke committed
176
177
178

/*!
* \brief get info vector from dataset
179
* \param handle an instance of dataset
Guolin Ke's avatar
Guolin Ke committed
180
181
182
183
* \param field_name field name
* \param field_data pointer to vector
* \return 0 when succeed, -1 when failure happens
*/
184
LIGHTGBM_C_EXPORT SEXP LGBM_DatasetGetField_R(
185
  LGBM_SE handle,
Guolin Ke's avatar
Guolin Ke committed
186
  LGBM_SE field_name,
187
  LGBM_SE field_data
188
);
Guolin Ke's avatar
Guolin Ke committed
189

190
/*!
191
192
193
194
195
 * \brief Raise errors for attempts to update dataset parameters
 * \param old_params Current dataset parameters
 * \param new_params New dataset parameters
 * \return 0 when succeed, -1 when failure happens
 */
196
LIGHTGBM_C_EXPORT SEXP LGBM_DatasetUpdateParamChecking_R(
197
  LGBM_SE old_params,
198
  LGBM_SE new_params
199
);
200

Guolin Ke's avatar
Guolin Ke committed
201
202
203
204
205
206
/*!
* \brief get number of data.
* \param handle the handle to the dataset
* \param out The address to hold number of data
* \return 0 when succeed, -1 when failure happens
*/
207
LIGHTGBM_C_EXPORT SEXP LGBM_DatasetGetNumData_R(
208
  LGBM_SE handle,
209
  LGBM_SE out
210
);
Guolin Ke's avatar
Guolin Ke committed
211
212
213
214
215
216
217

/*!
* \brief get number of features
* \param handle the handle to the dataset
* \param out The output of number of features
* \return 0 when succeed, -1 when failure happens
*/
218
LIGHTGBM_C_EXPORT SEXP LGBM_DatasetGetNumFeature_R(
219
  LGBM_SE handle,
220
  LGBM_SE out
221
);
Guolin Ke's avatar
Guolin Ke committed
222
223
224
225

// --- start Booster interfaces

/*!
226
* \brief create a new boosting learner
Guolin Ke's avatar
Guolin Ke committed
227
228
* \param train_data training data set
* \param parameters format: 'key1=value1 key2=value2'
229
* \param out handle of created Booster
Guolin Ke's avatar
Guolin Ke committed
230
231
* \return 0 when succeed, -1 when failure happens
*/
232
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterCreate_R(
233
  LGBM_SE train_data,
Guolin Ke's avatar
Guolin Ke committed
234
  LGBM_SE parameters,
235
  LGBM_SE out
236
);
Guolin Ke's avatar
Guolin Ke committed
237
238
239
240
241
242

/*!
* \brief free obj in handle
* \param handle handle to be freed
* \return 0 when succeed, -1 when failure happens
*/
243
244
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterFree_R(
  LGBM_SE handle
245
);
Guolin Ke's avatar
Guolin Ke committed
246
247
248
249

/*!
* \brief load an existing boosting from model file
* \param filename filename of model
250
* \param out handle of created Booster
Guolin Ke's avatar
Guolin Ke committed
251
252
* \return 0 when succeed, -1 when failure happens
*/
253
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterCreateFromModelfile_R(
254
  LGBM_SE filename,
255
  LGBM_SE out
256
);
Guolin Ke's avatar
Guolin Ke committed
257

258
259
260
261
262
263
/*!
* \brief load an existing boosting from model_str
* \param model_str string containing the model
* \param out handle of created Booster
* \return 0 when succeed, -1 when failure happens
*/
264
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterLoadModelFromString_R(
265
  LGBM_SE model_str,
266
  LGBM_SE out
267
);
268

Guolin Ke's avatar
Guolin Ke committed
269
/*!
270
* \brief Merge model in two boosters to first handle
Guolin Ke's avatar
Guolin Ke committed
271
272
273
274
* \param handle handle, will merge other handle to this
* \param other_handle
* \return 0 when succeed, -1 when failure happens
*/
275
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterMerge_R(
276
  LGBM_SE handle,
277
  LGBM_SE other_handle
278
);
Guolin Ke's avatar
Guolin Ke committed
279
280
281
282
283
284
285

/*!
* \brief Add new validation to booster
* \param handle handle
* \param valid_data validation data set
* \return 0 when succeed, -1 when failure happens
*/
286
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterAddValidData_R(
287
  LGBM_SE handle,
288
  LGBM_SE valid_data
289
);
Guolin Ke's avatar
Guolin Ke committed
290
291
292
293
294
295
296

/*!
* \brief Reset training data for booster
* \param handle handle
* \param train_data training data set
* \return 0 when succeed, -1 when failure happens
*/
297
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterResetTrainingData_R(
298
  LGBM_SE handle,
299
  LGBM_SE train_data
300
);
Guolin Ke's avatar
Guolin Ke committed
301
302
303
304
305
306
307

/*!
* \brief Reset config for current booster
* \param handle handle
* \param parameters format: 'key1=value1 key2=value2'
* \return 0 when succeed, -1 when failure happens
*/
308
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterResetParameter_R(
309
  LGBM_SE handle,
310
  LGBM_SE parameters
311
);
Guolin Ke's avatar
Guolin Ke committed
312
313

/*!
314
* \brief Get number of classes
Guolin Ke's avatar
Guolin Ke committed
315
316
317
318
* \param handle handle
* \param out number of classes
* \return 0 when succeed, -1 when failure happens
*/
319
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterGetNumClasses_R(
320
  LGBM_SE handle,
321
  LGBM_SE out
322
);
Guolin Ke's avatar
Guolin Ke committed
323
324
325
326
327
328

/*!
* \brief update the model in one round
* \param handle handle
* \return 0 when succeed, -1 when failure happens
*/
329
330
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterUpdateOneIter_R(
  LGBM_SE handle
331
);
Guolin Ke's avatar
Guolin Ke committed
332
333
334
335
336
337
338
339
340
341

/*!
* \brief update the model, by directly specify gradient and second order gradient,
*       this can be used to support customized loss function
* \param handle handle
* \param grad gradient statistics
* \param hess second order gradient statistics
* \param len length of grad/hess
* \return 0 when succeed, -1 when failure happens
*/
342
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterUpdateOneIterCustom_R(
343
  LGBM_SE handle,
Guolin Ke's avatar
Guolin Ke committed
344
345
  LGBM_SE grad,
  LGBM_SE hess,
346
  SEXP len
347
);
Guolin Ke's avatar
Guolin Ke committed
348
349
350
351
352
353

/*!
* \brief Rollback one iteration
* \param handle handle
* \return 0 when succeed, -1 when failure happens
*/
354
355
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterRollbackOneIter_R(
  LGBM_SE handle
356
);
Guolin Ke's avatar
Guolin Ke committed
357
358
359
360
361
362

/*!
* \brief Get iteration of current boosting rounds
* \param out iteration of boosting rounds
* \return 0 when succeed, -1 when failure happens
*/
363
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterGetCurrentIteration_R(
364
  LGBM_SE handle,
365
  LGBM_SE out
366
);
Guolin Ke's avatar
Guolin Ke committed
367

368
369
370
371
372
373
/*!
* \brief Get model upper bound value.
* \param handle Handle of booster
* \param[out] out_results Result pointing to max value
* \return 0 when succeed, -1 when failure happens
*/
374
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterGetUpperBoundValue_R(
375
    LGBM_SE handle,
376
    LGBM_SE out_result
377
378
379
380
381
382
383
384
);

/*!
* \brief Get model lower bound value.
* \param handle Handle of booster
* \param[out] out_results Result pointing to min value
* \return 0 when succeed, -1 when failure happens
*/
385
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterGetLowerBoundValue_R(
386
    LGBM_SE handle,
387
    LGBM_SE out_result
388
389
);

Guolin Ke's avatar
Guolin Ke committed
390
391
392
393
394
/*!
* \brief Get Name of eval
* \param eval_names eval names
* \return 0 when succeed, -1 when failure happens
*/
395
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterGetEvalNames_R(
396
  LGBM_SE handle,
397
  SEXP buf_len,
Guolin Ke's avatar
Guolin Ke committed
398
  LGBM_SE actual_len,
399
  LGBM_SE eval_names
400
);
Guolin Ke's avatar
Guolin Ke committed
401
402
403
404
405

/*!
* \brief get evaluation for training data and validation data
* \param handle handle
* \param data_idx 0:training data, 1: 1st valid data, 2:2nd valid data ...
406
* \param out_result float array contains result
Guolin Ke's avatar
Guolin Ke committed
407
408
* \return 0 when succeed, -1 when failure happens
*/
409
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterGetEval_R(
410
  LGBM_SE handle,
411
  SEXP data_idx,
412
  LGBM_SE out_result
413
);
Guolin Ke's avatar
Guolin Ke committed
414
415
416
417
418
419
420
421

/*!
* \brief Get number of prediction for training data and validation data
* \param handle handle
* \param data_idx 0:training data, 1: 1st valid data, 2:2nd valid data ...
* \param out size of predict
* \return 0 when succeed, -1 when failure happens
*/
422
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterGetNumPredict_R(
423
  LGBM_SE handle,
424
  SEXP data_idx,
425
  LGBM_SE out
426
);
Guolin Ke's avatar
Guolin Ke committed
427
428

/*!
429
430
* \brief Get prediction for training data and validation data.
*        This can be used to support customized eval function
Guolin Ke's avatar
Guolin Ke committed
431
432
433
434
435
* \param handle handle
* \param data_idx 0:training data, 1: 1st valid data, 2:2nd valid data ...
* \param out_result, used to store predict result, should pre-allocate memory
* \return 0 when succeed, -1 when failure happens
*/
436
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterGetPredict_R(
437
  LGBM_SE handle,
438
  SEXP data_idx,
439
  LGBM_SE out_result
440
);
Guolin Ke's avatar
Guolin Ke committed
441
442
443
444
445
446
447
448
449
450
451
452

/*!
* \brief make prediction for file
* \param handle handle
* \param data_filename filename of data file
* \param data_has_header data file has header or not
* \param is_rawscore
* \param is_leafidx
* \param num_iteration number of iteration for prediction, <= 0 means no limit
* \return 0 when succeed, -1 when failure happens
* \return 0 when succeed, -1 when failure happens
*/
453
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterPredictForFile_R(
454
  LGBM_SE handle,
Guolin Ke's avatar
Guolin Ke committed
455
  LGBM_SE data_filename,
456
457
458
459
460
461
  SEXP data_has_header,
  SEXP is_rawscore,
  SEXP is_leafidx,
  SEXP is_predcontrib,
  SEXP start_iteration,
  SEXP num_iteration,
462
  LGBM_SE parameter,
463
  LGBM_SE result_filename
464
);
Guolin Ke's avatar
Guolin Ke committed
465
466
467
468
469
470
471
472

/*!
* \brief Get number of prediction
* \param handle handle
* \param num_row
* \param is_rawscore
* \param is_leafidx
* \param num_iteration number of iteration for prediction, <= 0 means no limit
473
* \param out_len length of prediction
Guolin Ke's avatar
Guolin Ke committed
474
475
* \return 0 when succeed, -1 when failure happens
*/
476
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterCalcNumPredict_R(
477
  LGBM_SE handle,
478
479
480
481
482
483
  SEXP num_row,
  SEXP is_rawscore,
  SEXP is_leafidx,
  SEXP is_predcontrib,
  SEXP start_iteration,
  SEXP num_iteration,
484
  LGBM_SE out_len
485
);
Guolin Ke's avatar
Guolin Ke committed
486
487

/*!
488
* \brief make prediction for a new data set
Guolin Ke's avatar
Guolin Ke committed
489
*        Note:  should pre-allocate memory for out_result,
490
*               for normal and raw score: its length is equal to num_class * num_data
Guolin Ke's avatar
Guolin Ke committed
491
492
493
494
495
*               for leaf index, its length is equal to num_class * num_data * num_iteration
* \param handle handle
* \param indptr pointer to row headers
* \param indices findex
* \param data fvalue
496
* \param num_indptr number of cols in the matrix + 1
497
* \param nelem number of non-zero elements in the matrix
Guolin Ke's avatar
Guolin Ke committed
498
499
500
501
502
503
504
* \param num_row number of rows
* \param is_rawscore
* \param is_leafidx
* \param num_iteration number of iteration for prediction, <= 0 means no limit
* \param out prediction result
* \return 0 when succeed, -1 when failure happens
*/
505
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterPredictForCSC_R(
506
  LGBM_SE handle,
Guolin Ke's avatar
Guolin Ke committed
507
508
509
  LGBM_SE indptr,
  LGBM_SE indices,
  LGBM_SE data,
510
511
512
513
514
515
516
517
  SEXP num_indptr,
  SEXP nelem,
  SEXP num_row,
  SEXP is_rawscore,
  SEXP is_leafidx,
  SEXP is_predcontrib,
  SEXP start_iteration,
  SEXP num_iteration,
518
  LGBM_SE parameter,
519
  LGBM_SE out_result
520
);
Guolin Ke's avatar
Guolin Ke committed
521
522

/*!
523
* \brief make prediction for a new data set
Guolin Ke's avatar
Guolin Ke committed
524
*        Note:  should pre-allocate memory for out_result,
525
*               for normal and raw score: its length is equal to num_class * num_data
Guolin Ke's avatar
Guolin Ke committed
526
527
528
*               for leaf index, its length is equal to num_class * num_data * num_iteration
* \param handle handle
* \param data pointer to the data space
529
530
* \param num_row number of rows
* \param num_col number columns
Guolin Ke's avatar
Guolin Ke committed
531
532
533
534
535
536
* \param is_rawscore
* \param is_leafidx
* \param num_iteration number of iteration for prediction, <= 0 means no limit
* \param out prediction result
* \return 0 when succeed, -1 when failure happens
*/
537
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterPredictForMat_R(
538
  LGBM_SE handle,
Guolin Ke's avatar
Guolin Ke committed
539
  LGBM_SE data,
540
541
542
543
544
545
546
  SEXP num_row,
  SEXP num_col,
  SEXP is_rawscore,
  SEXP is_leafidx,
  SEXP is_predcontrib,
  SEXP start_iteration,
  SEXP num_iteration,
547
  LGBM_SE parameter,
548
  LGBM_SE out_result
549
);
Guolin Ke's avatar
Guolin Ke committed
550
551
552
553
554
555
556
557

/*!
* \brief save model into file
* \param handle handle
* \param num_iteration, <= 0 means save all
* \param filename file name
* \return 0 when succeed, -1 when failure happens
*/
558
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterSaveModel_R(
559
  LGBM_SE handle,
560
561
  SEXP num_iteration,
  SEXP feature_importance_type,
562
  LGBM_SE filename
563
);
Guolin Ke's avatar
Guolin Ke committed
564

565
566
567
568
569
570
571
/*!
* \brief create string containing model
* \param handle handle
* \param num_iteration, <= 0 means save all
* \param out_str string of model
* \return 0 when succeed, -1 when failure happens
*/
572
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterSaveModelToString_R(
573
  LGBM_SE handle,
574
575
576
  SEXP num_iteration,
  SEXP feature_importance_type,
  SEXP buffer_len,
577
  LGBM_SE actual_len,
578
  LGBM_SE out_str
579
);
580

Guolin Ke's avatar
Guolin Ke committed
581
582
583
584
585
586
587
/*!
* \brief dump model to json
* \param handle handle
* \param num_iteration, <= 0 means save all
* \param out_str json format string of model
* \return 0 when succeed, -1 when failure happens
*/
588
LIGHTGBM_C_EXPORT SEXP LGBM_BoosterDumpModel_R(
589
  LGBM_SE handle,
590
591
592
  SEXP num_iteration,
  SEXP feature_importance_type,
  SEXP buffer_len,
Guolin Ke's avatar
Guolin Ke committed
593
  LGBM_SE actual_len,
594
  LGBM_SE out_str
595
);
Guolin Ke's avatar
Guolin Ke committed
596

597
#endif  // LIGHTGBM_R_H_