Distance and clustering.
조회 수: 3 (최근 30일)
이전 댓글 표시
In k-means clustering code which uses Euclidean distance. I want to replace Euclidean distance by Mahalanobis distance.
댓글 수: 0
답변 (1개)
Image Analyst
2016년 8월 13일
Or just use the mahal() function if you have the Statistics and Machine Learning Toolbox:
Description d = mahal(Y,X) computes the Mahalanobis distance (in squared units) of each observation in Y from the reference sample in matrix X. If Y is n-by-m, where n is the number of observations and m is the dimension of the data, d is n-by-1. X and Y must have the same number of columns, but can have different numbers of rows. X must have more rows than columns.
댓글 수: 1
John D'Errico
2016년 8월 13일
hello_world has been asking the same question repeatedly. This is the 4th question I've seen from them on the exact same topic.
참고 항목
카테고리
Help Center 및 File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!