nearest

package
v0.0.0-...-e3597af Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(n Neighbor, w io.Writer) error

Types

type EuclidLSH

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

func NewEuclidLSH

func NewEuclidLSH(hashNum int) *EuclidLSH

func (*EuclidLSH) NeighborRowFromFV

func (e *EuclidLSH) NeighborRowFromFV(v FeatureVector, size int) []IDist

func (*EuclidLSH) NeighborRowFromID

func (e *EuclidLSH) NeighborRowFromID(id ID, size int) []IDist

func (*EuclidLSH) SetRow

func (e *EuclidLSH) SetRow(id ID, v FeatureVector)

type FeatureElement

type FeatureElement struct {
	Dim   string
	Value float32
}

type FeatureVector

type FeatureVector []FeatureElement

type ID

type ID uint32

type IDist

type IDist struct {
	ID   ID
	Dist float32
}

type LSH

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

func NewLSH

func NewLSH(bitNum int) *LSH

func (*LSH) NeighborRowFromFV

func (l *LSH) NeighborRowFromFV(v FeatureVector, size int) []IDist

func (*LSH) NeighborRowFromID

func (l *LSH) NeighborRowFromID(id ID, size int) []IDist

func (*LSH) SetRow

func (l *LSH) SetRow(id ID, v FeatureVector)

type Minhash

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

func NewMinhash

func NewMinhash(bitNum int) *Minhash

func (*Minhash) NeighborRowFromFV

func (m *Minhash) NeighborRowFromFV(v FeatureVector, size int) []IDist

func (*Minhash) NeighborRowFromID

func (m *Minhash) NeighborRowFromID(id ID, size int) []IDist

func (*Minhash) SetRow

func (m *Minhash) SetRow(id ID, v FeatureVector)

type Neighbor

type Neighbor interface {
	SetRow(id ID, v FeatureVector)
	NeighborRowFromID(id ID, size int) []IDist
	NeighborRowFromFV(v FeatureVector, size int) []IDist
	// contains filtered or unexported methods
}

func Load

func Load(r io.Reader) (Neighbor, error)

Jump to

Keyboard shortcuts

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