I want to delete all of the outliers I got from DBSCAN clustering, which are labelled -1.

1 次查看(过去 30 天)
How do I delete outliers I got from DBSCAN clustering?

回答(1 个)

Sharad
Sharad 2023-7-6
Hi,
As per my understanding, you are interested in deleting all the outliers obtained from DBSCAN clustering in MATLAB.
In order to do this, you can follow these steps:
  • The MATLAB dbscan function returns an array idx, containing the value that represents the cluster (cluster label) for each index or point in the input dataset.
idx = dbscan(X,epsilon,minpts)
  • The points which are outliers may be represented by -1 label, and you can easily locate those with the find() function.
outlierIndices = find(idx == -1);
  • Finally you can remove the outliers in the dataset like this.
newData = dataset;
newData(outlierIndices, :) = [];
Here are some documentation links that you might want to follow:
Thank you.

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by