streaming

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// MaxDistance is the max distance of streaming
	MaxDistance = "maxDistance"
)

Variables

This section is empty.

Functions

func NewAlgo

func NewAlgo(conf Conf, space core.Space, data []core.Elemt) *core.Algo

NewAlgo creates a new algorithm with a streaming implementation

Types

type Conf

type Conf struct {
	core.CtrlConf
	BufferSize int
	Mu         float64
	Sigma      float64
	OutRatio   float64
	OutAfter   int
	RGen       *rand.Rand
}

Conf represents the cofiguration of a streaming algorithm.

func (*Conf) SetDefaultValues added in v0.2.0

func (conf *Conf) SetDefaultValues()

SetDefaultValues applies default values to the given configuration.

func (*Conf) Verify

func (conf *Conf) Verify() (err error)

Verify checks if the given configuration is valid.

type Impl

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

Impl represents the implementation of the streaming clustering algorithm.

func NewImpl

func NewImpl(conf Conf, elemts []core.Elemt) Impl

NewImpl creates a new Impl instance.

func (*Impl) AddCenter

func (impl *Impl) AddCenter(cluster core.Elemt, distance float64)

AddCenter adds a new center.

func (*Impl) AddOutlier

func (impl *Impl) AddOutlier(outlier core.Elemt)

AddOutlier adds an outlier.

func (*Impl) Copy

func (impl *Impl) Copy(model core.OCModel) (core.Impl, error)

Copy impl

func (*Impl) GetClusters

func (impl *Impl) GetClusters() core.Clust

GetClusters returns the current cluster centers.

func (*Impl) GetMaxDistance

func (impl *Impl) GetMaxDistance() float64

GetMaxDistance returns the maximal distance between two clusters

func (*Impl) GetRelativeDistance

func (impl *Impl) GetRelativeDistance(distance float64) float64

GetRelativeDistance returns the ratio of given distance with the maximal distance if less than 1, otherwise 1.

func (*Impl) Init

func (impl *Impl) Init(model core.OCModel) (clust core.Clust, err error)

Init initializes the streaming algorithm.

func (*Impl) Iterate

func (impl *Impl) Iterate(model core.OCModel) (clust core.Clust, runtimeFigures core.RuntimeFigures, err error)

Iterate runs the streaming algorithm.

func (*Impl) Process

func (impl *Impl) Process(elemt core.Elemt, space core.Space)

Process a streaming iteration.

func (*Impl) Push

func (impl *Impl) Push(elemt core.Elemt, model core.OCModel) (err error)

Push pushes a new element

func (*Impl) UpdateCenter

func (impl *Impl) UpdateCenter(label int, elemt core.Elemt, distance float64, space core.Space)

UpdateCenter modifies an existing center.

func (*Impl) UpdateMaxDistance

func (impl *Impl) UpdateMaxDistance(distance float64)

UpdateMaxDistance changes the maximal distance between two clusters

Jump to

Keyboard shortcuts

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