vat算法


VAT (visual assessment of cluster)

transform the dissimilarity image into the Reorder Dissimilarity Image

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

%
% PROGRAM DESCRIPTION
% This is a MATLAB implementation of Visual Assessment of cluster Tendency (VAT).
%
% INPUT
% D: NxN dissimilarity matrix
%
% REFERENCES
% [1] J. C. Bezdek and R. J. Hathaway, "VAT: a tool for visual assessment
% of (cluster) tendency", Proc. Int. Joint Conf. Neural Netw. (IJCNN),
% vol. 3, 2002, pp. 2225-2230.
%
% Code written by Leonardo Enzo Brito da Silva
% Under the supervision of Dr. Donald C. Wunsch II
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% VAT reordering algorithm
function [Dstar, P, N] = (D)

% Setup
N = size(D, 1);
K = 1:N;
P = zeros(1, N);

% Starting point
[~, ind] = max(D(:));
[i, ~] = ind2sub([N N], ind);
P(1) = i;
I(1) = i;
J = K;
J(J==i) = [];

% Main VAT Loop
for r=2:N
Dtemp = D(I, J);
[~, ind] = min(Dtemp(:));
[~, j_temp] = ind2sub(size(Dtemp), ind);
j = J(j_temp);
P(r) = j;
I = [I; j];
J(J==j) = [];
end

% Output
Dstar = D(P, P);

end