Clear Filters
Clear Filters

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

7 views (last 30 days)
How do I delete outliers I got from DBSCAN clustering?

Answers (1)

Sharad
Sharad on 6 Jul 2023
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.

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!