# How do I convert an L2 norm to a probability?

I am using the dot product as a way to measure the similarly of two facial-model vectors extracted by a ML algorithm (OpenFace in fact).

I would like to convert the L2 norm to a probability U[0,1] in order to compare with other solutions from other providers that map directly to probabilities but in a blackbox fashion.

By probability I mean the probability that the two vectors represent the same person. So an identical image would give a probability of 1; images of the same person would give a high probability; and orthogonal images (different people, or some suitable toy case) would in the limit have such a probability of zero.

I'd like a uniform distribution for comparison with other providers, but this boils down to knowing what the underlying probability distribution of the feature vectors is.

How do I do this?

1. Rayleigh distribution CDF
2. Cosine similarity
3. (1) is the same as (2)
4. Draw from a simulated distribution
5. Arbitrarily scale to U[0,1]
6. Train into the comparison probability space directly (skipping the feature-vector step)
7. None of the above
8. Something else?

Cosine similarity versus dot product as distance metrics

http://blog.christianperone.com/2013/09/machine-learning-cosine-similarity-for-vector-space-models-part-iii

• Also: If the question is unclear, or better suited to a different stackexchange site, please ask for clarification/give constructive feedback rather than simply downvoting. If it's already answered elsewhere please advise. – jtlz2 Apr 5 '18 at 7:09
• I haven't downvoted your question but my question here would be: probability of what? – Konstantin Apr 5 '18 at 9:39
• @Konstantin Thanks for the helpful feedback - I hope my update clarifies? – jtlz2 Apr 5 '18 at 9:52
• Cosine similarity seems plausible(+1) It's nice Query. Not sure why downvoting is there.. – Aditya Apr 5 '18 at 10:09