Parse an eval result string from the booster.
(result: str)
| 96 | |
| 97 | |
| 98 | def _parse_eval_str(result: str) -> List[Tuple[str, float]]: |
| 99 | """Parse an eval result string from the booster.""" |
| 100 | splited = result.split()[1:] |
| 101 | # split up `test-error:0.1234` |
| 102 | metric_score_str = [tuple(s.split(":")) for s in splited] |
| 103 | # convert to float |
| 104 | metric_score = [(n, float(s)) for n, s in metric_score_str] |
| 105 | return metric_score |
| 106 | |
| 107 | |
| 108 | IterRange = TypeVar("IterRange", Optional[Tuple[int, int]], Tuple[int, int]) |
no outgoing calls
no test coverage detected