dotnet / dotnet/machinelearning-modelbuilder
Possible mixup in metrics for binary classification (leads to wrong model selected)
- Dominant language
- Dockerfile
- Stars
- 285
- Forks
- 66
- PR merge metrics
- No merged PRs in 30d
Description
**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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.