Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I better classify my data

1 回表示 (過去 30 日間)
Izem
Izem 2020 年 8 月 25 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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 件のコメント
Adam Danz
Adam Danz 2020 年 8 月 25 日
編集済み: Adam Danz 2020 年 8 月 25 日
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.
Izem
Izem 2020 年 8 月 25 日
Alright! thank you !

回答 (1 件)

Image Analyst
Image Analyst 2020 年 8 月 25 日
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 件のコメント
Izem
Izem 2020 年 8 月 25 日
Thank you for the answer. I will download this toolbox.

Community Treasure Hunt

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

Start Hunting!

Translated by