clustering-0.4.1: High performance clustering algorithms

Safe HaskellNone
LanguageHaskell2010

AI.Clustering.KMeans

Contents

Synopsis

Documentation

data KMeans a Source #

Results from running kmeans

Constructors

KMeans 

Fields

Instances
Show a => Show (KMeans a) Source # 
Instance details

Defined in AI.Clustering.KMeans.Types

Methods

showsPrec :: Int -> KMeans a -> ShowS #

show :: KMeans a -> String #

showList :: [KMeans a] -> ShowS #

data KMeansOpts Source #

Constructors

KMeansOpts 

Fields

defaultKMeansOpts :: KMeansOpts Source #

Default options. > defaultKMeansOpts = KMeansOpts > { kmeansMethod = KMeansPP > , kmeansSeed = U.fromList [1,2,3,4,5,6,7] > , kmeansClusters = True > , kmeansMaxIter = 10 > }

kmeans Source #

Arguments

:: Int

The number of clusters

-> Matrix Double

Input data stored as rows in a matrix

-> KMeansOpts 
-> KMeans (Vector Double) 

Perform K-means clustering

kmeansBy Source #

Arguments

:: Vector v a 
=> Int

The number of clusters

-> v a

Input data

-> (a -> Vector Double) 
-> KMeansOpts 
-> KMeans a 

Perform K-means clustering, using a feature extraction function

Initialization methods

data Method Source #

Different initialization methods

Constructors

Forgy

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

KMeansPP

K-means++ algorithm.

Centers (Matrix Double)

Provide a set of k centroids

decode :: Vector Int -> [a] -> [[a]] Source #

Assign data to clusters based on KMeans result

References

Arthur, D. and Vassilvitskii, S. (2007). k-means++: the advantages of careful seeding. Proceedings of the eighteenth annual ACM-SIAM symposium on Discrete algorithms. Society for Industrial and Applied Mathematics Philadelphia, PA, USA. pp. 1027–1035.