Skip to content

Commit

Permalink
[python-package] add type hints on Booster.save_model() (#5406)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Aug 7, 2022
1 parent c7102e5 commit 179564d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python-package/lightgbm/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 179564d

Please sign in to comment.