Sha256: 1651676707305e296cc579b2818e5c4ae132a943b32514084b5dcedd9e5fb921

Contents?: true

Size: 945 Bytes

Versions: 1

Compression:

Stored size: 945 Bytes

Contents

module Xgb
  module FFI
    extend ::FFI::Library
    ffi_lib ["xgboost"]

    # https://github.com/dmlc/xgboost/blob/master/include/xgboost/c_api.h
    # keep same order

    # error
    attach_function :XGBGetLastError, %i[], :string

    # dmatrix
    attach_function :XGDMatrixCreateFromMat, %i[pointer long long float pointer], :int
    attach_function :XGDMatrixNumCol, %i[pointer pointer], :int
    attach_function :XGDMatrixSetFloatInfo, %i[pointer string pointer long], :int

    # booster
    attach_function :XGBoosterCreate, %i[pointer int pointer], :int
    attach_function :XGBoosterUpdateOneIter, %i[pointer int pointer], :int
    attach_function :XGBoosterSetParam, %i[pointer string string], :int
    attach_function :XGBoosterPredict, %i[pointer pointer int int pointer pointer], :int
    attach_function :XGBoosterLoadModel, %i[pointer string], :int
    attach_function :XGBoosterSaveModel, %i[pointer string], :int
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
xgb-0.1.0 lib/xgb/ffi.rb