dotnet / dotnet/machinelearning-modelbuilder

Possible mixup in metrics for binary classification (leads to wrong model selected)

Offen
#3,046 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Dockerfile
Sterne
285
Forks
66
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**System Information (please complete the following information):**
- Model Builder Version (available in Manage Extensions dialog): 17.19.2.211501
- Visual Studio Version 2022

**Describe the bug**
Training a multi-category model with just a 2 classes with Macro-Accuracy optimization metric.

I get:
46 FastTreeOva 0.5500 1.2160 |
|47 FastTreeOva 0.5259 1.1710 |
|6 LightGbmBinary 0.6117 1586.0270 |
|17 LightGbmMulti 0.5003 560.4780 |
|7 SdcaLogisticRegressionBinary 0.6583 2.0900 |
|18 FastTreeOva 0.5179 1.3650 |
|19 FastTreeOva 0.5097 1.0210 |
|8 LbfgsLogisticRegressionBinary 0.6583 1.5410 |
|20 FastTreeOva 0.4868 1.2010 |

LbfgsLogisticRegressionBinary gets selected, but it is exactly at the null accuracy 0.658287% for the most common category so my suspect it is just selecting _true_ every time. If that is the case, then macro-accuracy should be 0.5%. I believe that is true, because the multiclass algorithms have much lower metrics.

Although I haven't confirmed the issue, I think the fact that binary variants report much higher accuracy point to the possibility of calculating the metric differently.

**To Reproduce**
1. Scenario: data classification
2. Set label to categorical . Make sure Boolean is not selected as type, but it just has 2 categories. For example, set 1/0 to numeric, true/false to text so binary algorithm variants will activated
3. Train

**Expected behavior**
Use macro-accuracy / balanced accuracy as the metric for all algorithms.

Ideally, in binary classification we should also see macro accuracy, or at least warning if it is exactly at null accuracy or always predicting one label.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginnen Sie damit, das Datenklassifizierungsszenario in Model Builder mit zwei kategorialen Klassen und der Optimierung auf Macro-Accuracy zu reproduzieren, und vergleichen Sie anschließend die gemeldeten Metriken und den ausgewählten Algorithmus zwischen binären und Multiclass-Varianten. Als erledigt gilt die Aufgabe, wenn das Metrikverhalten verifiziert und konsistent korrigiert wurde und das erwartete Warnverhalten behandelt ist, sofern der vorgeschlagene Fall des Issues bestätigt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
machine-learning
Bereich
machine-learning
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.