lib/xgboost.rb in xgb-0.2.1 vs lib/xgboost.rb in xgb-0.3.0
- old
+ new
@@ -154,9 +154,17 @@
end
eval_hist
end
+ def lib_version
+ major = ::FFI::MemoryPointer.new(:int)
+ minor = ::FFI::MemoryPointer.new(:int)
+ patch = ::FFI::MemoryPointer.new(:int)
+ FFI.XGBoostVersion(major, minor, patch)
+ "#{major.read_int}.#{minor.read_int}.#{patch.read_int}"
+ end
+
private
def mean(arr)
arr.sum / arr.size.to_f
end