SwiftKMeansPlusPlus

1.1.0

Swift implementation of the k-means++ algorithm that can operate on any collection of SIMD vectors
daprice/SwiftKMeansPlusPlus

What's New

v1.1.0

2025-05-16T23:20:10Z

The results of kMeansClusters(upTo:convergeDistance:using:) are now deterministic. This means that the results for a given collection will always be the same if you pass in a seedable random number generator with the same seed.

See /Tests/SwiftKMeansPlusPlusTests/SeedableLinearCongruentialRandomNumberGenerator for a (not cryptographically sound) example of a seedable RandomNumberGenerator that uses GameplayKit’s GKLinearCongruentialRandomSource.

SwiftKMeansPlusPlus

Swift implementation of the k-means++ algorithm that can operate on a collection of SIMD vectors of any length.

Overview

k-Means is an algorithm for partitioning a collection of points into clusters based on the cluster with the nearest mean value to each point. k-Means++ is an improved algorithm for choosing the initial cluster centers to avoid suboptimal clustering.

This library contains extensions to Collection that perform k-Means++ clustering on SIMD values of any length, which can represent points in Euclidean space, colors in formats like RGB or HSV, or just about anything else.

Description

  • Swift Tools 6.1.0
View More Packages from this Author

Dependencies

Last updated: Tue May 20 2025 05:05:58 GMT-0900 (Hawaii-Aleutian Daylight Time)