0

如何在 nctool 中添加 Jaccard 距离测量我已将 Jacdist.m 文件添加到以下路径

MATLAB\R2008b\toolbox\nnet\nnet\nndistance

Jacdist.m 源代码

function d = jacdist(pos)
%JACCARD Summary of this function goes here
%   Detailed explanation goes here
fn = mfilename;
if (nargin < 1), error('NNET:Arguments','Not enough arguments.'); end
if ischar(pos)
  switch(pos)
    case 'name'
      d = 'Jaccard Distance';
    otherwise, error('NNET:Arguments',['Unrecognized code: ''' pos ''''])
  end
  return
end

[dims,s] = size(pos);
d = zeros(s,s);
for i=1:s
  for j=1:(i-1)
    d(i,j) = pdist([pos(:,i) pos(:,j)],'jaccard');
  end
end
d = min(d(i,:));

然后在以下路径中将新的距离函数名称添加到 newsom.m

MATLAB\R2008b\toolbox\nnet\nnet\nnnetwork

但是聚类没有正确执行

4

0 回答 0