how to classify dataset based on multiple criterion?

1 回表示 (過去 30 日間)
pavan sunder
pavan sunder 2016 年 10 月 24 日
回答済み: Image Analyst 2016 年 10 月 24 日
i wanna classify dataset based on multiple criterion. nested if else statements will get me the results but i would like use more efficient and elegant method (something like supervised learning method).
for example
p range p1 range p2 range output
0 to -1 0 to 1 < 50 class 1
p range p1 range p2 range output
0 to -1 0 to 1 50 to 100 class 2
p range p1 range p2 range output
0 to -1 0 to 1 >100 class 3
p range p1 range p2 range output
0.1 to 1 -0.1 to -1 < 50 class 4
p range p1 range p2 range output
0.1 to 1 -0.1 to -1 50 to 100 class 5
p range p1 range p2 range output
0.1 to 1 -0.1 to -1 > 100 class 6
I tried classification learner app but couldn't achieve the results. kindly help me.

回答 (1 件)

Image Analyst
Image Analyst 2016 年 10 月 24 日
If those are your known criteria, then you don't need any fancy classification code or functions, simple use a series of if/else statements:
if p > -1 && p < 0 && p1 > 0 && p1 < 1 && p2 < 50
theClass = 1;
elseif p > -1 && p < 0 && p1 > 0 && p1 < 1 && p2 > 50 && p2 < 100
theClass = 2;
etc.

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by