Kmeans clustering mahalanobis distance

7 views (last 30 days)
shaifali gupta
shaifali gupta on 17 May 2017
Answered: on 3 Dec 2024
Can anyone share the code of kmeans clustering that uses mahalanobis distance instead of euclidean distance

Answers (2)

the cyclist
the cyclist on 17 May 2017
Will kmedoids do what you want?
  6 Comments
shaifali gupta
shaifali gupta on 17 May 2017
I am trying it... It gives error The covariance matrix for the Mahalanobis metric must be symmetric and positive definite.
Can you tell how can I resolve it
the cyclist
the cyclist on 17 May 2017
It seems that your current question has been answered here. (Maybe someone else will else also add some other answers, of course.)
I suggest you open a new question now, for specific help on working with the kmedoids function. In that new question, please add more detail, perhaps adding a MAT file with your data, or a small example of what is not working for you. As I mentioned, I am not very familiar with that function, and you might get help from more people with a new question.

Sign in to comment.


白
on 3 Dec 2024
You could try nearestPSD, which could transform your covariance matrix into symmetric and positive definite one, but there is some estimation bias to check.

Tags

Community Treasure Hunt

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

Start Hunting!