is there any way to use both Spearman and Euclidean distance using knnsearch ?

조회 수: 1 (최근 30일)
in my programe I'm using them separatly as in the text below :
%% Distance effect
idx=knnsearch(subject_train,subject_test,'distance','Euclidean');
%idx=knnsearch(subject_train,subject_test,'distance','spearman');
I assume that there is a way to merge the two functions to get better results, I expect that one of them can compensate the bad results of the other one

채택된 답변

the cyclist
the cyclist 2019년 5월 21일
No, they cannot both be used within a single call to knnsearch.
I don't really see how "merging" would really be that helpful. It seems to me that that would be effectively equivalent to defining some new, different distance metric. If one of the tried and tested distance functions doesn't really do a good job, I don't think a newfangled one will do much better.
You could, in principle, create your own version of knnsearch that does that merging, by copying the built-in function into your own directory, calculating both distances inside your new function, and somehow do the "merging" you have in mind.

추가 답변 (1개)

zakaria debih
zakaria debih 2019년 5월 22일
thanks Sir, I'll try it manually then.
the next table will show why did I think about merging the functions ..it seemed a stupid idea but I have to test it to make sure.
New Bitmap Image.bmp
left column for Euclidean and the right for Spearman. I wanted to increase the recognition rate as much as possible.

카테고리

Help CenterFile Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by