Вопрос

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