Magnitude returns the magnitude of the vector.
()
| 91 | |
| 92 | // Magnitude returns the magnitude of the vector. |
| 93 | func (w *Record) Magnitude() float64 { |
| 94 | return math.Sqrt(float64(w.Dot(w))) |
| 95 | } |
| 96 | |
| 97 | // Cosine returns the cosine similarity between a vector and another. |
| 98 | func (w *Record) Cosine(b *Record) float64 { |