MCPcopy Create free account
hub / github.com/catboost/catboost / __setstate__

Method __setstate__

catboost/python-package/catboost/core.py:1764–1783  ·  view source on GitHub ↗
(self, state)

Source from the content-addressed store, hash-verified

1762 return params
1763
1764 def __setstate__(self, state):
1765 if '_object' not in dict(self.__dict__.items()):
1766 self._object = _CatBoost()
1767 if '_init_params' not in dict(self.__dict__.items()):
1768 self._init_params = {}
1769 if '__model' in state:
1770 self._load_from_string(state['__model'])
1771 del state['__model']
1772 if '_test_eval' in state:
1773 self._set_test_evals([state['_test_eval']])
1774 del state['_test_eval']
1775 if '_test_evals' in state:
1776 self._set_test_evals(state['_test_evals'])
1777 del state['_test_evals']
1778 for attr in ['_prediction_values_change', '_loss_value_change']:
1779 if attr in state:
1780 setattr(self, attr, state[attr])
1781 del state[attr]
1782 self._init_params.update(state)
1783 self._canonized_params = None
1784
1785 def __copy__(self):
1786 return self.__deepcopy__(None)

Callers 3

__deepcopy__Method · 0.80

Calls 5

_load_from_stringMethod · 0.95
_set_test_evalsMethod · 0.95
dictClass · 0.85
setattrFunction · 0.85
updateMethod · 0.45

Tested by 2