# Machine Learning

### Cosine Similarity

Cosine similarity measures the similarity between two vectors of an inner product space. It is measured by the cosine of the angle between two vectors and determines whether two vectors are pointing in roughly the same direction. It is often used to measure document similarity in text analysis. from: https://www.sciencedirect.com/topics/computer-science/cosine-similarity

This similarity measure isn't limited to computer vision, but we can use this in comparing two images, which are represented as vectors.

How similar are the two images? Are they "going in the same direction?"

...it measures the cosine of the angle between two vectors projected in a multi-dimensional space...The smaller the angle, higher the cosine similarity. from: https://www.machinelearningplus.com/nlp/cosine-similarity/

Children