kmeans

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result[T any] struct {
	Centroids  []T
	Labels     []int
	Iterations int
}

Result holds the results of k-means clustering

func Run

func Run[T any](points []T, centroidCount int, maxIterations int, tolerance float64, space vector.Space[T]) Result[T]

Run performs k-means clustering on a set of 3D points

func Run1D

func Run1D[T vector.Number](points []T, centroidCount int, maxIterations int, tolerance float64) Result[T]

func Run2D

func Run2D[T vector.Number](points []vector2.Vector[T], centroidCount int, maxIterations int, tolerance float64) Result[vector2.Vector[T]]

func Run3D

func Run3D[T vector.Number](points []vector3.Vector[T], centroidCount int, maxIterations int, tolerance float64) Result[vector3.Vector[T]]

func Run4D

func Run4D[T vector.Number](points []vector4.Vector[T], centroidCount int, maxIterations int, tolerance float64) Result[vector4.Vector[T]]

Jump to

Keyboard shortcuts

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