How do I deal with different class sizes when classifying data with a petternnet?

1 回表示 (過去 30 日間)
I want to classify datasets using a patternnet. I have 2 classes (labelled 1 and 2). However, class 2 is significantly smaller than class 1 (ratio 1:9). The patternnet always classifies every sample into class 1, reaching 90% accuracy with it.
Is there any way to weigh or prioritize my classes so that this is not viewed as the best solution? (e.g. a cost matrix like for a decision tree (fitctree))
  4 件のコメント
MaHa
MaHa 2021 年 3 月 17 日
I see I misunderstood sorry. What happens if you reduce the number of labbelled 1 to the number of labbelled 2 ? Does it still classes everything in L1 ?
Anne Bernhart
Anne Bernhart 2021 年 3 月 17 日
If I do that it works fine but I would prefer including all of my data.

サインインしてコメントする。

採用された回答

Shravan Kumar Vankaramoni
Shravan Kumar Vankaramoni 2021 年 3 月 25 日
Hi Anne,
Have a look at the below thread. Hope that answers your question
  1 件のコメント
Anne Bernhart
Anne Bernhart 2021 年 3 月 27 日
thank you very much! That is exactly what I was looking for :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeClassification についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by