Biskit :: FuzzyCluster :: FuzzyCluster :: Class FuzzyCluster
[hide private]
[frames] | no frames]

Class FuzzyCluster

source code

Instance Methods [hide private]
  __init__(self, data, n_cluster, weight, seedx=0, seedy=0)
  calc_membership_matrix(self, d2)
  calc_cluster_center(self, msm)
  updateDistanceMatrix(self)
array, array, array iterate(self, centers)
Returns distance to the centers, membership matrix, array of cenetrs
float error(self, msm, d2)
Returns weighted error
array('f') create_membership_matrix(self)
Create a random membership matrix.
array('f') go(self, errorthreshold, n_iterations=1e10, nstep=10, verbose=1)
Start the cluestering.
  clusterEntropy(self)
  entropy(self)
  nonFuzzyIndex(self)
  clusterPartitionCoefficient(self)
  partitionCoefficient(self)
  getMembershipMatrix(self)
  getClusterCenter(self)
  entropySD(self)
  standardDeviation(self)

Method Details [hide private]

__init__(self, data, n_cluster, weight, seedx=0, seedy=0)
(Constructor)

source code 
Parameters:
  • data ([float] OR array) - cluster this
  • n_cluster (int) - number of clusters
  • weight (float) - fuzziness weigth
  • seedx (int OR 0) - random seed value for RandomArray.seed (default: 0)
  • seedy (int OR 0) - random seed value for RandomArray.seed (default: 0, set seed from clock)

calc_membership_matrix(self, d2)

source code 

calc_cluster_center(self, msm)

source code 

updateDistanceMatrix(self)

source code 

iterate(self, centers)

source code 
Parameters:
  • centers (array('f')) - array with cluster centers
Returns: array, array, array
distance to the centers, membership matrix, array of cenetrs

error(self, msm, d2)

source code 
Parameters:
  • msm (array('f')) - membership matrix
  • d2 (array('f')) - distance from data to the centers
Returns: float
weighted error

create_membership_matrix(self)

source code 

Create a random membership matrix.
Returns: array('f')
random array of shape length of data to cluster times number of clusters

go(self, errorthreshold, n_iterations=1e10, nstep=10, verbose=1)

source code 

Start the cluestering. Run until the error is below the error treshold or the max number of iterations have been run.
Parameters:
  • errorthreshold (float) - treshold value for error
  • n_iterations (int) - treshold value for number of iterations (default: 1e10)
  • nstep (int) - print information for every n'th step in the iteration
Returns: array('f')
array with cluster centers

clusterEntropy(self)

source code 

entropy(self)

source code 

nonFuzzyIndex(self)

source code 

clusterPartitionCoefficient(self)

source code 

partitionCoefficient(self)

source code 

getMembershipMatrix(self)

source code 

getClusterCenter(self)

source code 

entropySD(self)

source code 

standardDeviation(self)

source code