MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / __setstate__

Method __setstate__

python-package/lightgbmmt/basic.py:1805–1815  ·  view source on GitHub ↗
(self, state)

Source from the content-addressed store, hash-verified

1803 return this
1804
1805 def __setstate__(self, state):
1806 model_str = state.get('handle', None)
1807 if model_str is not None:
1808 handle = ctypes.c_void_p()
1809 out_num_iterations = ctypes.c_int(0)
1810 _safe_call(_LIB.LGBM_BoosterLoadModelFromString(
1811 c_str(model_str),
1812 ctypes.byref(out_num_iterations),
1813 ctypes.byref(handle)))
1814 state['handle'] = handle
1815 self.__dict__.update(state)
1816
1817 def free_dataset(self):
1818 """Free Booster's Datasets.

Callers

nothing calls this directly

Calls 4

_safe_callFunction · 0.85
updateMethod · 0.80
c_strFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected