Implements some of the MAD-Bayes algorithms by Tamara et al.
The DP-means algorithm by Kulis et al.
The DP-means algorithm by Kulis et al.
Parameters : |
---|
Returns: | Cluster indicator variables |
---|
Algorithm:
- Number of clusters \(K=1\)
- Global cluster mean \(\mu_1 = \frac{1}{n} \sum_n x_n\)
- Cluster indicator variables \(z_n = 0 \quad \forall n\)
- For each point \(n\):
- Compute distance to each cluster \(d_{nk} = ||x_n - \mu_k||^2\)
- If \(\min d_{nk} > \lambda\) then set \(K=K+1, z_n=K, \mu_k=x_n\)
- Otherwise set \(z_n= \arg\!\min_k d_{nk}\)
- For each cluster \(k\), compute \(\mu_k = \frac{1}{|\{n: z_n = k\}|}\sum_{n: z_n = k} x_n\)