Borrar filtros
Borrar filtros

how to classify dataset based on multiple criterion?

2 visualizaciones (últimos 30 días)
pavan sunder
pavan sunder el 24 de Oct. de 2016
Respondida: Image Analyst el 24 de Oct. de 2016
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.

Respuestas (1)

Image Analyst
Image Analyst el 24 de Oct. de 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.

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by