MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / _CVBooster

Class _CVBooster

python-package/lightgbmmt/engine.py:276–295  ·  view source on GitHub ↗

Auxiliary data struct to hold all boosters of CV.

Source from the content-addressed store, hash-verified

274
275
276class _CVBooster(object):
277 """Auxiliary data struct to hold all boosters of CV."""
278
279 def __init__(self):
280 self.boosters = []
281 self.best_iteration = -1
282
283 def append(self, booster):
284 """Add a booster to _CVBooster."""
285 self.boosters.append(booster)
286
287 def __getattr__(self, name):
288 """Redirect methods call of _CVBooster."""
289 def handler_function(*args, **kwargs):
290 """Call methods with each booster, and concatenate their results."""
291 ret = []
292 for booster in self.boosters:
293 ret.append(getattr(booster, name)(*args, **kwargs))
294 return ret
295 return handler_function
296
297
298def _make_n_folds(full_data, folds, nfold, params, seed, fpreproc=None, stratified=True,

Callers 1

_make_n_foldsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected