Fri Jul 23 15:29:57 CDT 2010
On Fri, Jul 23, 2010 at 3:18 PM, Lutz Maibaum <firstname.lastname@example.org>wrote:
> On Jul 23, 2010, at 12:40 PM, Benjamin Root wrote
> > Just to be clear, the C Clustering library's implementation of kmeans is
> > different from SciPy's implementation. While I am certainly no expert in
> > which approach is better than another, I can say that I have used it
> before and it has
> > worked very nicely for me and my uses.
> I am not sure the implementations are so different (possible bugs not
> withstanding ;). At implementation in the C clustering library does the
> 1. Start with an initial guess of the cluster assignments
> 2. Compute means for each cluster
> 3. Assign each data point to the nearest cluster mean.
> 4. If the cost function did not decrease or the maximum number of
> iterations has been reached => exit
> 5. Go to 2.
>From the C Clustering Library's documentation:
The expectation-maximization (EM) algorithm is commonly used to find the
> into k groups. The first step in the EM algorithm is to create k clusters
> and randomly assign
> items (genes or microarrays) to them. We then iterate:
> • Calculate the centroid of each cluster;
> • For each item, determine which cluster centroid is closest;
> • Reassign the item to that cluster.
> The iteration is stopped if no further item reassignments take place.
The C Clustering Library makes an initial guess of the assignments and
calculates the medians of the assignments.
SciPy's kmeans makes an initial guess of the centroids and assigns the obs
to the different centroid guesses.
It is a subtle difference, but it does result in different ways to solve the
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User