parent
8d15024ac7
commit
31ad40b963
@ -363,7 +363,9 @@ class DMatrix(object):
|
|||||||
nthread))
|
nthread))
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
_check_call(_LIB.XGDMatrixFree(self.handle))
|
if self.handle is not None:
|
||||||
|
_check_call(_LIB.XGDMatrixFree(self.handle))
|
||||||
|
self.handle = None
|
||||||
|
|
||||||
def get_float_info(self, field):
|
def get_float_info(self, field):
|
||||||
"""Get float property from the DMatrix.
|
"""Get float property from the DMatrix.
|
||||||
@ -738,7 +740,9 @@ class Booster(object):
|
|||||||
self.load_model(model_file)
|
self.load_model(model_file)
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
_LIB.XGBoosterFree(self.handle)
|
if self.handle is not None:
|
||||||
|
_check_call(_LIB.XGBoosterFree(self.handle))
|
||||||
|
self.handle = None
|
||||||
|
|
||||||
def __getstate__(self):
|
def __getstate__(self):
|
||||||
# can't pickle ctypes pointers
|
# can't pickle ctypes pointers
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user