vectormath

package
v0.0.0-...-accb3fc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CosineSimilarity

func CosineSimilarity(x []float64, y []float64) (float64, error)

CosineSimilarity calculates the cosine similarity between two vectors. cos(d_1, d_2) = (d_1 . d_2) / (||d_1|| * ||d_2||)

func EuclideanDistance

func EuclideanDistance(x []float64, y []float64) (float64, error)

func Intercept

func Intercept(a []float64, b []float64) ([]float64, error)

func ManhattanDistance

func ManhattanDistance(x []float64, y []float64) (float64, error)

func PearsonCorrelation

func PearsonCorrelation(a, b []float64) (float64, error)

Types

type Distance

type Distance int
const (
	Euclidean Distance = 0
	Cosine    Distance = 1
	Manhattan Distance = 2
	Pearson   Distance = 3
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL