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

Method test_shotgun

tests/python/test_linear.py:80–91  ·  view source on GitHub ↗
(self, param, num_rounds, dataset)

Source from the content-addressed store, hash-verified

78 )
79 @settings(deadline=None, max_examples=20, print_blob=True)
80 def test_shotgun(self, param, num_rounds, dataset):
81 param['updater'] = 'shotgun'
82 param = dataset.set_params(param)
83 result = train_result(param, dataset.get_dmat(), num_rounds)['train'][dataset.metric]
84 note(result)
85 # shotgun is non-deterministic, so we relax the test by only using first and last
86 # iteration.
87 if len(result) > 2:
88 sampled_result = (result[0], result[-1])
89 else:
90 sampled_result = result
91 assert tm.non_increasing(sampled_result)
92
93 @given(
94 parameter_strategy,

Callers

nothing calls this directly

Calls 3

get_dmatMethod · 0.80
train_resultFunction · 0.70
set_paramsMethod · 0.45

Tested by

no test coverage detected