Exception of early stopping.
| 11 | |
| 12 | |
| 13 | class EarlyStopException(Exception): |
| 14 | """Exception of early stopping.""" |
| 15 | |
| 16 | def __init__(self, best_iteration, best_score): |
| 17 | """Create early stopping exception. |
| 18 | |
| 19 | Parameters |
| 20 | ---------- |
| 21 | best_iteration : int |
| 22 | The best iteration stopped. |
| 23 | best_score : float |
| 24 | The score of the best iteration. |
| 25 | """ |
| 26 | super(EarlyStopException, self).__init__() |
| 27 | self.best_iteration = best_iteration |
| 28 | self.best_score = best_score |
| 29 | |
| 30 | |
| 31 | # Callback environment used by callbacks |
no outgoing calls
no test coverage detected