Copyright | (c) 2015 Kai Zhang |
---|---|
License | MIT |
Maintainer | kai@kzhang.org |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Kmeans clustering
- data KMeans = KMeans {}
- kmeans :: (PrimMonad m, Matrix mat Vector Double) => Gen (PrimState m) -> Method -> Int -> mat Vector Double -> m KMeans
- kmeansBy :: (PrimMonad m, Vector v a) => Gen (PrimState m) -> Method -> Int -> v a -> (a -> Vector Double) -> m KMeans
- kmeansWith :: Vector v a => Matrix Double -> v a -> (a -> Vector Double) -> KMeans
- data Method
- decode :: KMeans -> [a] -> [[a]]
- withinSS :: KMeans -> Matrix Double -> [Double]
Documentation
Results from running kmeans
kmeans :: (PrimMonad m, Matrix mat Vector Double) => Gen (PrimState m) -> Method -> Int -> mat Vector Double -> m KMeans Source
Perform K-means clustering
:: (PrimMonad m, Vector v a) | |
=> Gen (PrimState m) | |
-> Method | |
-> Int | number of clusters |
-> v a | data stores in rows |
-> (a -> Vector Double) | |
-> m KMeans |
K-means algorithm
:: Vector v a | |
=> Matrix Double | initial set of k centroids |
-> v a | each row represents a point |
-> (a -> Vector Double) | |
-> KMeans |
K-means algorithm
Initialization methods
Different initialization methods
Useful functions
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.