elastic / elastic/ml-cpp

[ML] overall_accuracy is low for an imbalanced classification

オープン
#1,955 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
:ml/DataFrameAnalysis >bug good first issue
主要言語
C++
スター
157
フォーク
67
平均マージ
17時間 52分
マージ済み PR(30日)
20

説明

When using sklean imbalanced dataset (imbalanced ratio 99:1), our DFA job shows poor performance: overall_accuracy is 0.02

Step to reproduce:

On latest master build (Jul 19's)

1. On Data Visualizer, import the `imbalance.csv` file to index: `imbalance`
[imbalance.csv](https://github.com/elastic/ml-cpp/files/6849734/imbalance.csv)

2. During the import, change the mapping of column 30 from double to long:
```
"30": {
"type": "long"
}
```

3. Create and start dfa job from dev console:

```
PUT _ml/data_frame/analytics/imbalance
{
"source": {
"index": [
"imbalance"
],
"query": {
"match_all": {}
}
},
"dest": {
"index": "dest-imbalance",
"results_field": "ml"
},
"analysis": {
"classification" : {
"dependent_variable" : "30",
"class_assignment_objective" : "maximize_minimum_recall",
"num_top_classes" : 2,
"prediction_field_name" : "30_prediction",
"training_percent" : 80.0,
"randomize_seed" : 4642014714383011104,
"early_stopping_enabled" : true
}
},
"model_memory_limit": "1gb",
"allow_lazy_start": false,
"max_num_threads": 1
}

POST _ml/data_frame/analytics/imbalance/_start

```

4. Once job finishes, run the evaluation

```
POST _ml/data_frame/_evaluate
{
"index": "dest-imbalance",
"query": {
"term": {
"ml.is_training": {
"value": "false"
}
}
},
"evaluation": {
"classification": {
"actual_field": "30",
"predicted_field": "ml.30_prediction",
"metrics": {
"accuracy" : {}
}
}
}
}
```

**Result:**
```
{
"classification" : {
"accuracy" : {
"classes" : [
{
"class_name" : "0",
"value" : 0.02
},
{
"class_name" : "1",
"value" : 0.02
}
],
"overall_accuracy" : 0.02
}
}
}
```

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Data Visualizer、_ml/data_frame/analytics の start request、および _ml/data_frame/_evaluate の accuracy request を通じて、imbalance.csv のワークフローを再現します。次に、accuracy メトリックの分類評価パスを追跡し、2 つのクラスの扱いを比較します。この不均衡なデータセットに対して、評価が正しい overall_accuracy を報告すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp
領域
machine-learning
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。