Sha256: cc061703dfc5ba3e208a314be8fb1231c2bf4c17c9bc64544be78be17db47065

Contents?: true

Size: 1.94 KB

Versions: 1

Compression:

Stored size: 1.94 KB

Contents

module XGBoost
  module FFI
    extend ::FFI::Library

    ffi_lib XGBoost.ffi_lib

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

    # general
    attach_function :XGBoostVersion, %i[pointer pointer pointer], :void
    attach_function :XGBGetLastError, %i[], :string

    # dmatrix
    attach_function :XGDMatrixCreateFromMat, %i[pointer uint64 uint64 float pointer], :int
    attach_function :XGDMatrixSetUIntInfo, %i[pointer string pointer uint64], :int
    attach_function :XGDMatrixNumRow, %i[pointer pointer], :int
    attach_function :XGDMatrixNumCol, %i[pointer pointer], :int
    attach_function :XGDMatrixSliceDMatrix, %i[pointer pointer uint64 pointer], :int
    attach_function :XGDMatrixFree, %i[pointer], :int
    attach_function :XGDMatrixSaveBinary, %i[pointer string int], :int
    attach_function :XGDMatrixSetFloatInfo, %i[pointer string pointer uint64], :int
    attach_function :XGDMatrixGetFloatInfo, %i[pointer string pointer pointer], :int

    # booster
    attach_function :XGBoosterCreate, %i[pointer int pointer], :int
    attach_function :XGBoosterUpdateOneIter, %i[pointer int pointer], :int
    attach_function :XGBoosterEvalOneIter, %i[pointer int pointer pointer uint64 pointer], :int
    attach_function :XGBoosterFree, %i[pointer], :int
    attach_function :XGBoosterSetParam, %i[pointer string string], :int
    attach_function :XGBoosterPredict, %i[pointer pointer int int int pointer pointer], :int
    attach_function :XGBoosterLoadModel, %i[pointer string], :int
    attach_function :XGBoosterSaveModel, %i[pointer string], :int
    attach_function :XGBoosterDumpModelExWithFeatures, %i[pointer int pointer pointer int string pointer pointer], :int
    attach_function :XGBoosterGetAttr, %i[pointer pointer pointer pointer], :int
    attach_function :XGBoosterSetAttr, %i[pointer pointer pointer], :int
    attach_function :XGBoosterGetAttrNames, %i[pointer pointer pointer], :int
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
xgb-0.3.1 lib/xgboost/ffi.rb