distance

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package distance provides distance metrics in the data space.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Distance

type Distance interface {
	Name() string
	Distance(node, data []float64) float64
}

func GetMetric

func GetMetric(name string) (Distance, bool)

type Euclidean

type Euclidean struct{}

func (*Euclidean) Distance

func (d *Euclidean) Distance(node, data []float64) float64

func (*Euclidean) Name

func (d *Euclidean) Name() string

type Hamming

type Hamming struct{}

func (*Hamming) Distance

func (d *Hamming) Distance(node, data []float64) float64

func (*Hamming) Name

func (d *Hamming) Name() string

type Manhattan

type Manhattan struct{}

func (*Manhattan) Distance

func (d *Manhattan) Distance(node, data []float64) float64

func (*Manhattan) Name

func (d *Manhattan) Name() string

type SumOfSquares

type SumOfSquares struct{}

func (*SumOfSquares) Distance

func (d *SumOfSquares) Distance(node, data []float64) float64

func (*SumOfSquares) Name

func (d *SumOfSquares) Name() string

Jump to

Keyboard shortcuts

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