سؤال

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?

هل كانت مفيدة؟

المحلول

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.

نصائح أخرى

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top