clusterer

package module
v0.0.0-...-fe80670 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: GPL-3.0 Imports: 0 Imported by: 1

Documentation

Overview

clusterer exposes basic iteration clustering functionality

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster interface {
	AddPoint(Clusterable) error
	RemovePoint(Clusterable)
	Points() []Clusterable
	CalculateCenter() interface{}
	SetCenter(interface{})
}

type ClusterFactory

type ClusterFactory func(func(Cluster)) Cluster

type Clusterable

type Clusterable interface {
	GetCluster() Cluster
	SetCluster(Cluster)
}

type Clusterer

type Clusterer struct {
	Clusters            []Cluster
	Clusterables        []Clusterable
	Criteria            Criteria
	ClusterF            ClusterFactory
	ClusterConstructor  func(Cluster)
	ReEvaluationCircles int
}

Clusterer struct

func NewClusterer

func NewClusterer(criteria Criteria, ClusterF ClusterFactory, ClusterConstructor func(Cluster), ReEvaluationCircles int) *Clusterer

NewClusterer creates a new Clusterer instance

func (*Clusterer) Cluster

func (c *Clusterer) Cluster(cs []Clusterable) error

Start clustering

func (*Clusterer) GenerateClusters

func (c *Clusterer) GenerateClusters() error

GenerateClusters forms clusters

func (*Clusterer) ReEvaluateClusters

func (c *Clusterer) ReEvaluateClusters() error

ReEvaluateClusters performs a re evaluation on the generated clusters

type Criteria

type Criteria func(Clusterable, Cluster) (bool, error)

Jump to

Keyboard shortcuts

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