![]() |
Bsoft 2.1.4
Bernard's software package
|
Header file for clustering functions. More...
#include "Matrix.h"
Functions | |
vector< long > | k_means (long n, float *data, long k) |
Generate clusters using a K-means algorithm. More... | |
vector< long > | affin_prop_clustering (Matrix s, long maxit, long convit, double lambda, long &ncluster) |
Generate clusters from a similarity matrix using affinity propagation. More... | |
Header file for clustering functions.
vector< long > affin_prop_clustering | ( | Matrix | s, |
long | maxit, | ||
long | convit, | ||
double | lambda, | ||
long & | ncluster | ||
) |
Generate clusters from a similarity matrix using affinity propagation.
s | n x n similarity matrix. |
maxit | maximum iterations. |
convit | convergence iterations. |
lambda | damping factor. |
&ncluster | number of clusters. |
Frey, B. J. and D. Dueck (2007). "Clustering by passing messages between data points." Science 315(5814): 972-6. The clustering algorithm proceeds iteratively for a given maximum iterations. If the cluster solution does not change for a given number of iterations (convit), convergence is assumed and the function finishes. The damping factor should be ~0.5, or at least between 0.1 and 0.9. For larger damping factors, more convergence iterations are required. The diagonal of the matrix should be set to preferences for exemplars (typically the average or median of the similarities).
vector< long > k_means | ( | long | n, |
float * | data, | ||
long | k | ||
) |
Generate clusters using a K-means algorithm.
n | number of data elements. |
*data | floating point array. |
k | number of classes. |