Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How can I better classify my data
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi everyone,
I am trying to separate data into two groups using clustering (k-means) as you can see in the picture attached. My algorithm work perfectly on some data (see pic1),the problem is that it does not work in some regions for other data (see pic2), do you have any suggestions on how I can better filter the upper points ? Do you think a regression on the lower points would solve the problem ? If yes how can I do it only for these lower points and not all the data ?
Thank you in advance :)
11 comentarios
Adam Danz
el 25 de Ag. de 2020
Editada: Adam Danz
el 25 de Ag. de 2020
You can access the residuals using
[pop,gof,output] = fit(X1,Y1,'poly2');
resid = output.residuals;
however, that will only contain the residuals of the data used for fitting (blue dots). You need the residuals for all of the dots so you'll need to compute the residuals.
[pop,gof,output] = fit(X1,Y1,'poly2');
resids = pop(XALL) - YALL;
where XALL and YALL are the coordinates to all of the points. pop(XALL) produces the y-estimates. Subtract the actual y coordinates from the y-estimates to get the residuals.
For thresholding, use absolute values of the residuals.
Respuestas (1)
Image Analyst
el 25 de Ag. de 2020
I'd use fitPolynomialRANSAC(), if you have the Computer Vision Toolbox. Train it with values less than 1 and fit a second or third order polynomial. RANSAC had the advantage over "dumb" regressions in that it can fit a polynomial through extremely noisy neighborhoods. So the points in that shotgun blast cluster on the right won't be all in one class.
1 comentario
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!