MCPcopy Create free account
hub / github.com/evilsocket/sum / Magnitude

Method Magnitude

wrapper/record.go:93–95  ·  view source on GitHub ↗

Magnitude returns the magnitude of the vector.

()

Source from the content-addressed store, hash-verified

91
92// Magnitude returns the magnitude of the vector.
93func (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.
98func (w *Record) Cosine(b *Record) float64 {

Callers 4

CosineMethod · 0.95

Calls 1

DotMethod · 0.95