how to classify dataset based on multiple criterion?

2 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Statistics 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