class KMeans extends Clusterer
This clusterer uses the KMeans algorithm for clustering documents.
It accepts as parameters the number of clusters and the distance metric
as well as the methodology for computing the new centroids (thus it
can be used to cluster documents in spaces other than the euclidean
vector space).
A description of this algorithm can be found at
http://en.wikipedia.org/wiki/K-means_clustering
Methods
array |
cluster(TrainingSet $documents, FeatureFactoryInterface $ff)
Apply the feature factory to the documents and then cluster the resulting array using the provided distance metric and centroid factory. |
|
__construct(int $n, DistanceInterface $d, CentroidFactoryInterface $cf, float $cutoff = 1.0E-5)
Initialize the K Means clusterer |
Details
at line 46
public array
cluster(TrainingSet $documents, FeatureFactoryInterface $ff)
Apply the feature factory to the documents and then cluster the resulting array using the provided distance metric and centroid factory.
at line 34
public
__construct(int $n, DistanceInterface $d, CentroidFactoryInterface $cf, float $cutoff = 1.0E-5)
Initialize the K Means clusterer