๐๐ถ๐๐๐ฎ๐ป๐ฐ๐ฒ๐ ๐ฎ๐ป๐ฑ ๐ฆ๐ถ๐บ๐ถ๐น๐ฎ๐ฟ๐ถ๐๐ ๐ถ๐ป ๐ ๐
Machine learning is about comparison. You need to know if two objects are similar. You do this by turning data into vectors.
You use three tools to measure this.
Euclidean Distance
- This is ruler distance.
- It measures the gap between two points.
- A small gap means objects are similar.
- Scale matters here. Normalize your data first.
Dot Product
- This measures direction and size.
- A high score means vectors align and are long.
- It mixes direction and scale.
- Neural networks use this for relevance.
Cosine Similarity
- This only measures direction.
- It ignores vector length.
- This is best for text search.
- It finds similar meaning regardless of text length.
These functions turn vectors into numbers. Your algorithm uses these numbers to make decisions.
Source: https://dev.to/samuel_akopyan_e902195a96/distances-and-similarity-in-ml-3ckh Optional learning community: https://apphp.gitbook.io/ai-for-php-developers