how can I choose representative days from existing data clusters using kmeans built function?

Hello,
I am using the build in function in MATLAB [idx,C] = kmeans(M,k) to find reprensetative days for a whole year. the representaive days found are not from the existing defined days in my matrix.
My question is that I want the represnative days to be chosen from the real days (the centroid to be choosen from one of the data in the cluster). How can I choose the representative days from the existing data?
Please any help
Thank you very much

 채택된 답변

Cris LaPierre
Cris LaPierre 2021년 3월 17일
편집: Cris LaPierre 2021년 3월 17일
Sounds like you want kmedoids instead, as that will always use an existing data point as the cluster centroid.
From the More About section in the documentation
  • The k-medoids algorithm returns medoids which are the actual data points in the data set. This allows you to use the algorithm in situations where the mean of the data does not exist within the data set. This is the main difference between k-medoids and k-means where the centroids returned by k-means may not be within the data set. Hence k-medoids is useful for clustering categorical data where a mean is impossible to define or interpret

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Cluster Analysis and Anomaly Detection에 대해 자세히 알아보기

질문:

2021년 3월 17일

편집:

2021년 3월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by