# pairwise

package
Version: v0.0.0-...-4fa0698 Latest Latest

Go to latest
Published: May 24, 2014 License: MIT

## Documentation ¶

### Overview ¶

Package pairwise implements utilities to evaluate pairwise distances or inner product (via kernel).

### Constants ¶

This section is empty.

### Variables ¶

This section is empty.

### Functions ¶

This section is empty.

### Types ¶

#### type Chebyshev ¶

`type Chebyshev struct{}`

#### func NewChebyshev ¶

`func NewChebyshev() *Chebyshev`

#### func (*Chebyshev) Distance ¶

`func (self *Chebyshev) Distance(vectorX *mat64.Dense, vectorY *mat64.Dense) float64`

#### type Cranberra ¶

`type Cranberra struct{}`

#### func NewCranberra ¶

`func NewCranberra() *Cranberra`

#### func (*Cranberra) Distance ¶

`func (self *Cranberra) Distance(vectorX *mat64.Dense, vectorY *mat64.Dense) float64`

#### type Euclidean ¶

`type Euclidean struct{}`

#### func NewEuclidean ¶

`func NewEuclidean() *Euclidean`

#### func (*Euclidean) Distance ¶

`func (self *Euclidean) Distance(vectorX *mat64.Dense, vectorY *mat64.Dense) float64`

Compute Euclidean distance (also known as L2 distance).

#### func (*Euclidean) InnerProduct ¶

`func (self *Euclidean) InnerProduct(vectorX *mat64.Dense, vectorY *mat64.Dense) float64`

Compute Eucledian inner product.

#### type Manhattan ¶

`type Manhattan struct{}`

#### func NewManhattan ¶

`func NewManhattan() *Manhattan`

#### func (*Manhattan) Distance ¶

`func (self *Manhattan) Distance(vectorX *mat64.Dense, vectorY *mat64.Dense) float64`

Manhattan distance, also known as L1 distance. Compute sum of absolute values of elements.

#### type PolyKernel ¶

```type PolyKernel struct {
// contains filtered or unexported fields
}```

#### func NewPolyKernel ¶

`func NewPolyKernel(degree int) *PolyKernel`

Return a d-degree polynomial kernel

#### func (*PolyKernel) Distance ¶

`func (self *PolyKernel) Distance(vectorX *mat64.Dense, vectorY *mat64.Dense) float64`

Compute distance under the polynomial kernel, maybe no need.

#### func (*PolyKernel) InnerProduct ¶

`func (self *PolyKernel) InnerProduct(vectorX *mat64.Dense, vectorY *mat64.Dense) float64`

Compute inner product through kernel trick K(x, y) = (x^T y + 1)^d

#### type RBFKernel ¶

```type RBFKernel struct {
// contains filtered or unexported fields
}```

#### func NewRBFKernel ¶

`func NewRBFKernel(gamma float64) *RBFKernel`

#### func (*RBFKernel) InnerProduct ¶

`func (self *RBFKernel) InnerProduct(vectorX *mat64.Dense, vectorY *mat64.Dense) float64`

Compute inner product through kernel trick K(x, y) = exp(-gamma * ||x - y||^2)