MCPcopy Create free account
hub / github.com/dmlc/xgboost / _parse_eval_str

Function _parse_eval_str

python-package/xgboost/core.py:98–105  ·  view source on GitHub ↗

Parse an eval result string from the booster.

(result: str)

Source from the content-addressed store, hash-verified

96
97
98def _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
108IterRange = TypeVar("IterRange", Optional[Tuple[int, int]], Tuple[int, int])

Callers 3

scoreMethod · 0.85
after_iterationMethod · 0.85
check_precision_scoreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected