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

2 ビュー (過去 30 日間)
student
student 2023 年 7 月 5 日
回答済み: Sharad 2023 年 7 月 6 日
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 Center および File ExchangeStatistics 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