We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If the eval metric has is_higher_better set to True then the objective should be maximized.
def higher_is_better(self) -> bool: metric_name = self.lgbm_params.get("metric", "binary_logloss") return metric_name in ("auc", "auc_mu", "ndcg", "map", "average_precision")
This code is totally incorrect if someone is using a custom evaluation metric.
I only found out about this bug after wasting several hours tuning and the best parameters that were returned being obviously nonsense.
I then tried explicitly creating a study with direction set to 'maximize' and at least hit a warning message.
feval
def score_cb(preds, eval_data): score = calculate_score(preds, eval_data.label) return 'score', score, True lgb_study = optuna.create_study(direction="maximize", study_name="LightGBM Auto Tune") params = { "objective": "regression", "metric": "correlation", "boosting_type": "gbdt", } model = opt_lgb.train(params, dtrain, study=lgb_study, num_boost_round=2000, valid_sets=[dtrain, dval], valid_names=["training", "validation"], feval=score_cb, callbacks=[opt_lgb.early_stopping(stopping_rounds=30), lgb.log_evaluation(1)])
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Expected behavior
If the eval metric has is_higher_better set to True then the objective should be maximized.
Environment
Error messages, stack traces, or logs
This code is totally incorrect if someone is using a custom evaluation metric.
I only found out about this bug after wasting several hours tuning and the best parameters that were returned being obviously nonsense.
I then tried explicitly creating a study with direction set to 'maximize' and at least hit a warning message.
Steps to reproduce
feval
callback functionfeval
callable to the function created in step 2Additional context (optional)
No response
The text was updated successfully, but these errors were encountered: