kmeans

package
v0.0.0-...-c753a40 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: BSD-3-Clause, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package kmeans implements the k-means clustering algorithm See: https://en.wikipedia.org/wiki/K-means_clustering

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kmeans

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

Kmeans configuration/option struct

func New

func New() Kmeans

New returns a Kmeans configuration struct with default settings

func NewWithOptions

func NewWithOptions(deltaThreshold float64, plotter Plotter) (Kmeans, error)

NewWithOptions returns a Kmeans configuration struct with custom settings

func (Kmeans) Partition

func (m Kmeans) Partition(dataset clusters.Observations, k int) (clusters.Clusters, error)

Partition executes the k-means algorithm on the given dataset and partitions it into k clusters

type Plotter

type Plotter interface {
	Plot(cc clusters.Clusters, iteration int) error
}

The Plotter interface lets you implement your own plotters

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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