def _crossval_predict(self, **kargs):
proba = kargs.pop('proba', False)
fold = int(kargs.pop('fold'))
Mod = kargs.pop('Mod')
Mod = deepcopy(Mod)
Mod.update(params=self.format_params(Mod['params'], fold))
context = Mod.pop('context', [mx.gpu(0)])
# import pickle
# d = kargs.copy()
# d.update(Mod=Mod, fold=fold)
# print(pickle.dumps(d))
# Ensure load from disk.
# Otherwise following cached methods like vote will have two caches,
# one for the first computation,
# and the other for the cached one.
func = _crossval_predict_aux if not proba else _crossval_predict_proba_aux
return func.call_and_shelve(self, Mod=Mod, fold=fold, context=context, **kargs).get()
评论列表
文章目录