how to classify dataset based on multiple criterion?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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.
0 commentaires
Réponses (1)
Image Analyst
le 24 Oct 2016
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.
0 commentaires
Voir également
Catégories
En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!