Question

I have 2 fixed length arrays of doubles. I want to get a similarity measure of these 2 arrays. The closer each elements in the arrays are the more similar the 2 arrays are.

What kind of metric or algorithm is there to achieve that?

Was it helpful?

Solution

Simplest and universal is "Sum of Squared Differences" In case of scaled data can help "Normalized cross correlation"

Also you can read about different "norm" L1, L2, INF and others. All it depend from your practical task.

OTHER TIPS

You can use cosine similarity, which is a measure insensitive to the magnitude of data, as it calculates the angle between the vectors.

enter image description here

See also: https://en.wikipedia.org/wiki/Cosine_similarity

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top