From 1e2c26a0744ca5f6d778307392a6b3920071319d Mon Sep 17 00:00:00 2001 From: Piotr Date: Mon, 3 Jun 2024 13:47:18 +0200 Subject: [PATCH] fix accuracy metric for lightgbm (#728) --- requirements.txt | 2 +- supervised/utils/metric.py | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index aabba841..99b58526 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/supervised/utils/metric.py b/supervised/utils/metric.py index 4fd0e6c4..96138f87 100644 --- a/supervised/utils/metric.py +++ b/supervised/utils/metric.py @@ -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