INNER CODE UNIT · Python
counter_num_comb
fabsig/GPBoost · python-package/gpboost/engine.py:1231
counter_num_comb = counter_num_comb + 1
if return_all_combinations:
if higher_better:
best_num_boost_round = np.argmax(cvbst[next(iter(cvbst))]) + 1
else:
best_num_boost_round = np.argmin(cvbst[next(iter(cvbst))]) + 1
all_combinations[param_comb_number] = {'params': param_comb, 'num_boost_round': best_num_boost_round,
'score': current_score}
if best_num_boost_round < 0 or best_score == (1e99 if not higher_better else -1e99):
raise ValueError("Did not find any valid parameter combination. " \
"Check the 'metric' (is it supported?), search space, and the data provided ")
if return_all_combinations:
return {'best_params': best_params, 'best_iter': best_num_boost_round, 'best_score': best_score,
'all_combinations': all_combinations}
else:
return {'best_params': best_params, 'best_iter': best_num_boost_round, 'best_score': best_score}