pairwise

package
v0.0.0-...-3fbf507 Latest Latest
Warning

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

Go to latest
Published: May 21, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

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

Index

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 (c *Chebyshev) Distance(vectorX *mat64.Dense, vectorY *mat64.Dense) float64

type Cranberra

type Cranberra struct{}

func NewCranberra

func NewCranberra() *Cranberra

func (*Cranberra) Distance

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

type Euclidean

type Euclidean struct{}

func NewEuclidean

func NewEuclidean() *Euclidean

func (*Euclidean) Distance

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

Distance computes Euclidean distance (also known as L2 distance).

func (*Euclidean) InnerProduct

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

InnerProduct computes a Eucledian inner product.

type Manhattan

type Manhattan struct{}

func NewManhattan

func NewManhattan() *Manhattan

func (*Manhattan) Distance

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

Distance computes the Manhattan distance, also known as L1 distance. == the sum of the absolute values of elements.

type PairwiseDistanceFunc

type PairwiseDistanceFunc interface {
	Distance(vectorX *mat64.Dense, vectorY *mat64.Dense) float64
}

type PolyKernel

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

func NewPolyKernel

func NewPolyKernel(degree int) *PolyKernel

NewPolyKernel returns a d-degree polynomial kernel

func (*PolyKernel) Distance

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

Distance computes distance under the polynomial kernel (maybe not needed?)

func (*PolyKernel) InnerProduct

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

InnerProduct computes the inner product through a 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

NewRBFKernel returns a representation of a Radial Basis Function Kernel

func (*RBFKernel) InnerProduct

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

InnerProduct computes the inner product through a kernel trick K(x, y) = exp(-gamma * ||x - y||^2)

Jump to

Keyboard shortcuts

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