clustering-0.1.2: High performance clustering algorithms

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

AI.Clustering.KMeans

Contents

Description

Kmeans clustering

Synopsis

Documentation

data KMeans Source

Results from running kmeans

Constructors

KMeans 

Fields

_clusters :: Vector Int

A vector of integers (0 ~ k-1) indicating the cluster to which each point is allocated.

_centers :: Matrix Double

A matrix of cluster centres.

Instances

kmeans Source

Arguments

:: PrimMonad m 
=> Gen (PrimState m) 
-> Initialization 
-> Int

number of clusters

-> Matrix Double

each row represents a point

-> m KMeans 

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

kmeansWith Source

Arguments

:: Matrix Double

initial set of k centroids

-> Matrix Double

each row represents a point

-> KMeans 

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

Initialization methods

data Initialization 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, not implemented.

decode :: KMeans -> [a] -> [[a]] Source

Assign data to clusters based on KMeans result