Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with own distance function when calculating Davies Bouldin #2

Open
bamaly opened this issue Jul 26, 2023 · 0 comments
Open

Error with own distance function when calculating Davies Bouldin #2

bamaly opened this issue Jul 26, 2023 · 0 comments

Comments

@bamaly
Copy link

bamaly commented Jul 26, 2023

I wanted to use my own distance function, as below:

distfun = @(XI,XJ)(1-abs(MyCorr(XI',XJ')));

MyCorr function:
function c = MyCorr(in1,in2)

% Average reference both sets of input maps
nO = size(in1,1);
Centering = eye(nO) - 1/nO;

in1 = Centering * in1;

if nargin < 2
    in2 = in1;
else
    in2 = Centering * in2;
end

% Compute covariance matrix between sets of input maps
covar = in1' * in2;
var1 = diag(in1' * in1);
var2 = diag(in2' * in2);

c = covar./sqrt(var1*var2');

While it works with the silhouette coefficient function, I get following error with Davies Bouldin:

Error using internal.stats.parseArgs
Invalid parameter name: Distance.

Error in clustering.evaluation.DaviesBouldinEvaluation (line 53)
      internal.stats.parseArgs(basePnames, baseDflts, varargin{:});

Error in evalclusters (line 190)
           obj = clustering.evaluation.DaviesBouldinEvaluation(X,YorFun,varargin{:});

Does someone no the whats the issue?
Thanks a lot in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant