| 1750 | return f"{self.__class__.__name__}({params_str})" |
| 1751 | |
| 1752 | def __getstate__(self): |
| 1753 | params = self._init_params.copy() |
| 1754 | test_evals = self._object._get_test_evals() |
| 1755 | if test_evals: |
| 1756 | params['_test_evals'] = test_evals |
| 1757 | if self.is_fitted(): |
| 1758 | params['__model'] = self._serialize_model() |
| 1759 | for attr in ['_prediction_values_change', '_loss_value_change']: |
| 1760 | if getattr(self, attr, None) is not None: |
| 1761 | params[attr] = getattr(self, attr, None) |
| 1762 | return params |
| 1763 | |
| 1764 | def __setstate__(self, state): |
| 1765 | if '_object' not in dict(self.__dict__.items()): |