(output: str)
| 47 | verbose_eval: Union[bool, int], |
| 48 | ): |
| 49 | def check_output(output: str) -> None: |
| 50 | if int(verbose_eval) == 1: |
| 51 | # Should print each iteration info |
| 52 | assert len(output.split("\n")) == rounds |
| 53 | elif int(verbose_eval) > rounds: |
| 54 | # Should print first and latest iteration info |
| 55 | assert len(output.split("\n")) == 2 |
| 56 | else: |
| 57 | # Should print info by each period additionaly to first and latest |
| 58 | # iteration |
| 59 | num_periods = rounds // int(verbose_eval) |
| 60 | # Extra information is required for latest iteration |
| 61 | is_extra_info_required = num_periods * int(verbose_eval) < (rounds - 1) |
| 62 | assert len(output.split("\n")) == ( |
| 63 | 1 + num_periods + int(is_extra_info_required) |
| 64 | ) |
| 65 | |
| 66 | evals_result: xgb.callback.TrainingCallback.EvalsLog = {} |
| 67 | params = {"objective": "binary:logistic", "eval_metric": "error"} |
no outgoing calls
no test coverage detected