GClasses
|
A K-means clustering algorithm where every point has partial membership in each cluster. This algorithm is specified in Li, D. and Deogun, J. and Spaulding, W. and Shuart, B., Towards missing data imputation: A study of fuzzy K-means clustering method, In Rough Sets and Current Trends in Computing, Springer, pages 573--579, 2004. More...
#include <GCluster.h>
Public Member Functions | |
GFuzzyKMeans (size_t nClusters, GRand *pRand) | |
~GFuzzyKMeans () | |
virtual void | cluster (GMatrix *pData) |
Performs clustering. | |
virtual size_t | whichCluster (size_t nVector) |
Identifies the cluster of the specified row. | |
void | init (GMatrix *pData) |
Selects random centroids and initializes internal data structures. | |
double | recomputeWeights () |
Assigns each row to partial membership in each cluster, as measured with the dissimilarity metric. Returns the weighted-sum-distance of each row with the centroids. | |
void | recomputeCentroids () |
Computes new centroids for each cluster. | |
GMatrix * | centroids () |
Returns a k x d matrix, where each row is one of the k centroids. | |
void | setFuzzifier (double d) |
Specifies how fuzzy the membership in each cluster should be. d should be greater than 1, and is typically about 1.3. | |
void | setReps (size_t r) |
Specify the number of times to cluster the data. The best clustering (as measured by the weighted-sum-difference between each point with the centroids) will be kept. | |
Protected Member Functions | |
bool | clusterAttempt (size_t nMaxIterations) |
bool | selectSeeds (GMatrix *pSeeds) |
Protected Attributes | |
GMatrix * | m_pCentroids |
GMatrix * | m_pData |
GMatrix * | m_pWeights |
double | m_fuzzifier |
size_t | m_reps |
GRand * | m_pRand |
A K-means clustering algorithm where every point has partial membership in each cluster. This algorithm is specified in Li, D. and Deogun, J. and Spaulding, W. and Shuart, B., Towards missing data imputation: A study of fuzzy K-means clustering method, In Rough Sets and Current Trends in Computing, Springer, pages 573--579, 2004.
GClasses::GFuzzyKMeans::GFuzzyKMeans | ( | size_t | nClusters, |
GRand * | pRand | ||
) |
GClasses::GFuzzyKMeans::~GFuzzyKMeans | ( | ) |
GMatrix* GClasses::GFuzzyKMeans::centroids | ( | ) | [inline] |
Returns a k x d matrix, where each row is one of the k centroids.
virtual void GClasses::GFuzzyKMeans::cluster | ( | GMatrix * | pData | ) | [virtual] |
Performs clustering.
Implements GClasses::GClusterer.
bool GClasses::GFuzzyKMeans::clusterAttempt | ( | size_t | nMaxIterations | ) | [protected] |
void GClasses::GFuzzyKMeans::init | ( | GMatrix * | pData | ) |
Selects random centroids and initializes internal data structures.
void GClasses::GFuzzyKMeans::recomputeCentroids | ( | ) |
Computes new centroids for each cluster.
double GClasses::GFuzzyKMeans::recomputeWeights | ( | ) |
Assigns each row to partial membership in each cluster, as measured with the dissimilarity metric. Returns the weighted-sum-distance of each row with the centroids.
bool GClasses::GFuzzyKMeans::selectSeeds | ( | GMatrix * | pSeeds | ) | [protected] |
void GClasses::GFuzzyKMeans::setFuzzifier | ( | double | d | ) | [inline] |
Specifies how fuzzy the membership in each cluster should be. d should be greater than 1, and is typically about 1.3.
void GClasses::GFuzzyKMeans::setReps | ( | size_t | r | ) | [inline] |
Specify the number of times to cluster the data. The best clustering (as measured by the weighted-sum-difference between each point with the centroids) will be kept.
virtual size_t GClasses::GFuzzyKMeans::whichCluster | ( | size_t | nVector | ) | [virtual] |
Identifies the cluster of the specified row.
Implements GClasses::GClusterer.
double GClasses::GFuzzyKMeans::m_fuzzifier [protected] |
GMatrix* GClasses::GFuzzyKMeans::m_pCentroids [protected] |
GMatrix* GClasses::GFuzzyKMeans::m_pData [protected] |
GRand* GClasses::GFuzzyKMeans::m_pRand [protected] |
GMatrix* GClasses::GFuzzyKMeans::m_pWeights [protected] |
size_t GClasses::GFuzzyKMeans::m_reps [protected] |