Skip to content

Commit

Permalink
Merge pull request #272 from nzw0301/unify-intermediate-and-objective
Browse files Browse the repository at this point in the history
Use auc score to unify the intermediate and objective values
  • Loading branch information
not522 authored Jul 29, 2024
2 parents 4241e47 + a231306 commit 81e4c9f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lightgbm/lightgbm_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"""

import numpy as np
import optuna

import lightgbm as lgb
Expand Down Expand Up @@ -46,9 +45,7 @@ def objective(trial):
gbm = lgb.train(param, dtrain, valid_sets=[dvalid], callbacks=[pruning_callback])

preds = gbm.predict(valid_x)
pred_labels = np.rint(preds)
accuracy = sklearn.metrics.accuracy_score(valid_y, pred_labels)
return accuracy
return sklearn.metrics.roc_auc_score(valid_y, preds)


if __name__ == "__main__":
Expand Down

0 comments on commit 81e4c9f

Please sign in to comment.