From 179564dfeef809b0c8b4bb63e160cd1fe4bcce73 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 7 Aug 2022 13:48:16 -0500 Subject: [PATCH] [python-package] add type hints on `Booster.save_model()` (#5406) --- python-package/lightgbm/basic.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python-package/lightgbm/basic.py b/python-package/lightgbm/basic.py index e05bfeb951d2..96b03e4f1db9 100644 --- a/python-package/lightgbm/basic.py +++ b/python-package/lightgbm/basic.py @@ -3352,7 +3352,13 @@ def eval_valid(self, feval=None): return [item for i in range(1, self.__num_dataset) for item in self.__inner_eval(self.name_valid_sets[i - 1], i, feval)] - def save_model(self, filename, num_iteration=None, start_iteration=0, importance_type='split'): + def save_model( + self, + filename: Union[str, Path], + num_iteration: Optional[int] = None, + start_iteration: int = 0, + importance_type: str = 'split' + ) -> "Booster": """Save Booster to file. Parameters