clustering-0.1.1: High performance clustering algorithms

Copyright(c) 2015 Kai Zhang
LicenseMIT
Maintainerkai@kzhang.org
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

AI.Clustering.KMeans

Description

Kmeans clustering

Synopsis

Documentation

kmeans Source

Arguments

:: (Vector v Double, Vector v Int, Eq (v Int), Eq (v Double), PrimMonad m) 
=> Gen (PrimState m) 
-> Int

number of clusters

-> Matrix v Double

each row represents a point

-> m (v Int, Matrix v Double)

membership vector

Lloyd's algorithm, also known as K-means algorithm

kmeansWith Source

Arguments

:: (Vector v Double, Vector v Int, Eq (v Int)) 
=> Matrix v Double

initial set of k centroids

-> Matrix v Double

each row represents a point

-> (v Int, Matrix v Double)

membership vector and centroids

Lloyd's algorithm, also known as K-means algorithm

forgyMethod :: (PrimMonad m, Vector v a, Eq (v a)) => Gen (PrimState m) -> Int -> Matrix v a -> m (Matrix v a) Source

The Forgy method randomly chooses k unique observations from the data set and uses these as the initial means