1

This question is regarding the weighted Euclidean distance. I have three features and I am using it as three dimensions. I need to place 2 projects named A and B in this 3 dimensional space and measure the distance among them.

But the case is I need to give them separate weights.

if first feature is given weight 1, second feature should be given weight 2 and third feature must be given weight 3.

If values of project A are (4,3,2) and values of project B are (6,2,7) can I use the weighted values as it is to calculate the distances between 2 projects?

Please someone kindly help me in solving this? If this method is wrong is there any other way that I can use this?

The basic thing what I need is giving them weights "what I need". This is just an example. I would be needed to expand this upto a n dimensional space. It would be able to be achieved using Euclidean distance. But main problem what I am facing is giving them weights what I am looking for.

P.S

enter image description here

Hiru
  • 151
  • 1
  • 1
  • 4

1 Answers1

2

You can indeed use the weighted Euclidean distance between $A$ and $B$ $$ d(A,B) = \sqrt{\sum_{i} w_{i}(A_{i}-B_{i})^{2}}, $$ where $A_{i}$ is the $i$-th feature for A and $w_{i}$ is the weight you want to give to feature $i$.

If you have many points in your space, one possible way to chose $w_{i}$ is the inverse variance of the feature $i$. It's called the Mahalanobis distance.

  • Please see what I updated. Have what I done ws correct? I have many points in my space. I can measure distance between them as well in the same way right? Could you please explain me that what is the use of Mahalanobis distance more comprehensively. – Hiru Sep 02 '14 at 16:14
  • Yes, it's correct. You can consult wikipedia for a description of the Mahalanobis distance. – citronrose Sep 03 '14 at 10:12
  • K thanks alot..... :) – Hiru Sep 03 '14 at 13:54
  • Why what an excellent answer my good sir. High-5 – badmf Feb 09 '17 at 20:21