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

Method check_output

tests/python/test_callback.py:49–64  ·  view source on GitHub ↗
(output: str)

Source from the content-addressed store, hash-verified

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"}

Callers 3

native_buildFunction · 0.80
get_current_commit_hashFunction · 0.80
get_current_git_branchFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected