line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package AI::XGBoost::CAPI::RAW; |
2
|
1
|
|
|
1
|
|
89408
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
23
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
160
|
use Alien::XGBoost; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use FFI::Platypus; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my $ffi = FFI::Platypus->new; |
9
|
|
|
|
|
|
|
$ffi->lib( Alien::XGBoost->dynamic_libs ); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.11'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# ABSTRACT: Perl wrapper for XGBoost C API https://github.com/dmlc/xgboost |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
$ffi->attach( XGBGetLastError => [] => 'string' ); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$ffi->attach( XGDMatrixCreateFromFile => [qw(string int opaque*)] => 'int' ); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
$ffi->attach( XGDMatrixCreateFromCSREx => [qw(size_t[] uint[] float[] size_t size_t size_t opaque*)] => 'int' ); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
$ffi->attach( XGDMatrixCreateFromCSCEx => [qw(size_t[] uint[] float[] size_t size_t size_t opaque*)] => 'int' ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
$ffi->attach( XGDMatrixCreateFromMat => [qw(float[] uint64 uint64 float opaque*)] => 'int' ); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
$ffi->attach( XGDMatrixCreateFromMat_omp => [qw(float[] uint64 uint64 float opaque* int)] => 'int' ); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$ffi->attach( XGDMatrixSliceDMatrix => [qw(opaque int[] uint64 opaque*)] => 'int' ); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$ffi->attach( XGDMatrixNumRow => [qw(opaque uint64*)] => 'int' ); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
$ffi->attach( XGDMatrixNumCol => [qw(opaque uint64*)] => 'int' ); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
$ffi->attach( XGDMatrixSaveBinary => [qw(opaque string int)] => 'int' ); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
$ffi->attach( XGDMatrixSetFloatInfo => [qw(opaque string float[] uint64)] => 'int' ); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
$ffi->attach( XGDMatrixSetUIntInfo => [qw(opaque string uint32* uint64)] => 'int' ); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
$ffi->attach( XGDMatrixSetGroup => [qw(opaque uint32* uint64)] => 'int' ); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
$ffi->attach( XGDMatrixGetFloatInfo => [qw(opaque string uint64* opaque*)] => 'int' ); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$ffi->attach( XGDMatrixGetUIntInfo => [qw(opaque string uint64* opaque*)] => 'int' ); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
$ffi->attach( XGDMatrixFree => [qw(opaque)] => 'int' ); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
$ffi->attach( XGBoosterCreate => [qw(opaque[] uint64 opaque*)] => 'int' ); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
$ffi->attach( XGBoosterFree => [qw(opaque)] => 'int' ); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
$ffi->attach( XGBoosterSetParam => [qw(opaque string string)] => 'int' ); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
$ffi->attach( XGBoosterBoostOneIter => [qw(opaque opaque float[] float[] uint64)] => 'int' ); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
$ffi->attach( XGBoosterUpdateOneIter => [qw(opaque int opaque)] => 'int' ); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
$ffi->attach( XGBoosterEvalOneIter => [qw(opaque int opaque[] opaque[] uint64 opaque*)] => 'int' ); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
$ffi->attach( XGBoosterPredict => [qw(opaque opaque int uint uint64* opaque*)] => 'int' ); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
$ffi->attach( XGBoosterLoadModel => [qw(opaque string)] => 'int' ); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
$ffi->attach( XGBoosterSaveModel => [qw(opaque string)] => 'int' ); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
$ffi->attach( XGBoosterLoadModelFromBuffer => [qw(opaque opaque uint64)] => 'int' ); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
$ffi->attach( XGBoosterGetModelRaw => [qw(opaque uint64* opaque*)] => 'int' ); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
$ffi->attach( XGBoosterDumpModel => [qw(opaque string int uint64* opaque*)] => 'int' ); |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
$ffi->attach( XGBoosterDumpModelEx => [qw(opaque string int string uint64* opaque*)] => 'int' ); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
$ffi->attach( XGBoosterDumpModelWithFeatures => [qw(opaque int opaque[] opaque[] int uint64* opaque*)] => 'int' ); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
$ffi->attach( |
76
|
|
|
|
|
|
|
XGBoosterDumpModelExWithFeatures => [qw(opaque int opaque[] opaque[] int string uint64* opaque*)] => 'int' ); |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
$ffi->attach( XGBoosterSetAttr => [qw(opaque string string)] => 'int' ); |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
$ffi->attach( XGBoosterGetAttr => [qw(opaque string opaque* int*)] => 'int' ); |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
$ffi->attach( XGBoosterGetAttrNames => [qw(opaque uint64* opaque*)] => 'int' ); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
$ffi->attach( XGBoosterLoadRabitCheckpoint => [qw(opaque int)] => 'int' ); |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
$ffi->attach( XGBoosterSaveRabitCheckpoint => [qw(opaque)] => 'int' ); |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
__END__ |