4
$\begingroup$

I compute Euclidian distances between a point I want to analyze and a set of points I have. I want to sort my points by decreasing "similarity".

I used to compute a "score" by inverting the distance ($s=1/d$), and use the $\cfrac{s_i}{\sum_k s_k}$ as a similarity that varies between $0$ and $1$.

I have seen that the $softmax$ function can also be used, the difference being that it uses $e^{1/d}$ as the score.

Which function would be closer to computing a kind of "probability"? I should apologize for probably mixing terms...

$\endgroup$
3
  • 2
    $\begingroup$ Probability of what? Both give nonnegative scores that sum to one. Neither is particularly anything like a probability. Softmax will decay quickly beyond the closest point, while the sum one will distribute scores more widely. $\endgroup$
    – Danica
    Feb 4 '17 at 1:40
  • $\begingroup$ If you're not familiar, you might want to look at kernels. $\endgroup$
    – Danica
    Feb 4 '17 at 1:42
  • $\begingroup$ @Dougal, thank you, your first comment answers my question ... and your second one gives me homework ;) If you add that as an answer I'll accept it. $\endgroup$
    – Matthieu
    Feb 4 '17 at 11:53
1
$\begingroup$

Credits to @Dougal for his comment-answer:

Both give nonnegative scores that sum to one. Neither is particularly anything like a probability. Softmax will decay quickly beyond the closest point, while the sum one will distribute scores more widely.

The decay part is interesting: $e^{1/x}$ is a lot bigger than $1/x$, so ${\sum_k e^x}$ will be a lot bigger than ${\sum_k 1/x}$, considering the value of $k$.

$\endgroup$
1
$\begingroup$

For those still looking for different answers, I was finding individual probabilities (something like Sigmoid) for similarity values provided by different algorithms. This is what I am doing.. $(1-e^{-1/x})/(1+e^{-1/x})$

Considering that similarity provides value from 0 to 1, where o being most relevant one. This has provided me with pretty good results, not sure if something like this can used for distance as well, may be taking modulus of x in above equation solves the problem. $(1-e^{-1/|x|})/(1+e^{-1/|x|})$

Please let me know if someone tries this.

Thanks

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.