File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ def train(
9191 evals_result . merge! ( cb_container . history )
9292 end
9393
94- bst
94+ bst . reset
9595 end
9696
9797 def cv (
Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ def save_config
4747 json_string . read_pointer . read_string ( length . read_uint64 ) . force_encoding ( Encoding ::UTF_8 )
4848 end
4949
50+ def reset
51+ check_call FFI . XGBoosterReset ( handle )
52+ self
53+ end
54+
5055 def attr ( key )
5156 ret = ::FFI ::MemoryPointer . new ( :pointer )
5257 success = ::FFI ::MemoryPointer . new ( :int )
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ module FFI
3939 attach_function :XGBoosterUpdateOneIter , %i[ pointer int pointer ] , :int
4040 attach_function :XGBoosterEvalOneIter , %i[ pointer int pointer pointer uint64 pointer ] , :int
4141 attach_function :XGBoosterFree , %i[ pointer ] , :int
42+ attach_function :XGBoosterReset , %i[ pointer ] , :int
4243 attach_function :XGBoosterBoostedRounds , %i[ pointer pointer ] , :int
4344 attach_function :XGBoosterSetParam , %i[ pointer string string ] , :int
4445 attach_function :XGBoosterGetNumFeature , %i[ pointer pointer ] , :int
You can’t perform that action at this time.
0 commit comments