Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metric ¶
type Metric interface { // CalcDistance ... calculates the distance between given vectors CalcDistance(v1, v2 []float64) float64 // GetSplittingVector ... calculates the splitting vector which becomes a node's vector in the index GetSplittingVector(vs [][]float64) []float64 // CalcDirectionPriority ... calculates the priority of the children nodes which can be used for determining // which way (right or left child) should go next traversal. The return values must be contained in [-1, 1]. CalcDirectionPriority(base, target []float64) float64 }
Metric is the interface of metrics which defines target search spaces.
func NewCosineMetric ¶
NewCosineMetric returns cosineDistance. NOTE: We assume that the given vectors are already normalized, i.e. the norm equals 1
Click to show internal directories.
Click to hide internal directories.