Skip to content

Commit

Permalink
fix accuracy metric for lightgbm (#728)
Browse files Browse the repository at this point in the history
  • Loading branch information
pplonski committed Jun 3, 2024
1 parent d2a8d3a commit 1e2c26a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ seaborn>=0.11.1
wordcloud>=1.8.1
category_encoders>=2.2.2
optuna>=2.7.0
mljar-scikit-plot>=0.3.8
mljar-scikit-plot>=0.3.11
markdown
typing-extensions
ipython
6 changes: 0 additions & 6 deletions supervised/utils/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,6 @@ def lightgbm_eval_metric_accuracy(preds, dtrain):
target = dtrain.get_label()
weight = dtrain.get_weight()

unique_targets = np.unique(target)
if len(unique_targets) > 2:
cols = len(unique_targets)
rows = int(preds.shape[0] / len(unique_targets))
preds = np.reshape(preds, (rows, cols), order="F")

return "accuracy", -negative_accuracy(target, preds, weight), True


Expand Down

0 comments on commit 1e2c26a

Please sign in to comment.