2

I have a set instances with features that I would like to compare with a reference set of values. For example, I have the instances with their features below:

\begin{array}{|l|l|l|l|}\hline Arrival Time & Departure Time & Processing Time & Wait Time \\\hline 3 & 6 & 25 & 20 \\\hline 19 & 5 & 20 & 21 \\\hline 40 & 10 & 42 & 42\\\hline \end{array}

The reference instance is: \begin{array}{|l|l|l|l|}\hline Arrival Time & Departure Time & Processing Time & Wait Time \\\hline 20 & 15 & 30 & 25 \\\hline \end{array}

I have been calculating how each instance matches to the reference features by treating each row as a vector and calculating their magnitude and dividing it with by the magnitude of the reference to give me values between 0 and 1.

I have a problem where I get values greater than 1. Is there any way to rectify that or even an alternate way of comparison? I require that the value be within that range so that I can feed it into another equation.

Intelligenti pauca
  • 50,470
  • 4
  • 42
  • 77
kbb
  • 123
  • 2

1 Answers1

1

For $d$ any metric on $\mathbb{R}^4$, $\frac{d}{d + 1}$ takes values between $0$ and $1$. So if $y$ is your reference, you can take $$x \mapsto \frac{d(x, y)}{d(x, y) + 1}$$ for your favourite metric $d$. For example the Euclidean one. This has as added benefit that the farther away you are from the reference value, the closer to $1$ this comparison function becomes, and it is only $0$ for the reference value itself.

user388557
  • 2,544