๐๐ถ๐๐๐ฎ๐ป๐ฐ๐ฒ๐ ๐ฎ๐ป๐ฑ ๐ฆ๐ถ๐บ๐ถ๐น๐ฎ๐ฟ๐ถ๐๐ ๐ถ๐ป ๐ ๐
ML compares objects using vectors. You need to know if two objects are similar. You use three main tools.
Euclidean distance is a ruler.
- It measures the straight line between two points.
- It cares about scale.
- Normalize your data first.
- k-NN uses this tool.
Dot product tracks direction and size.
- High numbers mean vectors align and are long.
- Neural networks use this for relevance.
Cosine similarity tracks direction only.
- It ignores length.
- This is best for text and embeddings.
- It shows if two vectors point the same way.
Source: https://dev.to/samuel_akopyan_e902195a96/distances-and-similarity-in-ml-3ckh Optional learning community: https://apphp.gitbook.io/ai-for-php-developers