Clustering

class pyfume.Clustering.Clusterer(nr_clus, x_train=None, y_train=None, data=None, relational_data=None, verbose=False)

Bases: object

Creates a new clusterer object that can cluster the (training) data in the input-output feature space. The user should specify the ‘data’argument OR the ‘x_train’ and ‘y_train’ argument.

Parameters
  • nr_clus – Number of clusters that should be identified in the data.

  • x_train – The input data (default = None).

  • y_train – The output data (true label/golden standard) (default = None).

  • data – The data to be clustered (default = None).

cluster(method='fcm', **kwargs)

Clusters the data using the clustering method as specified by the user.

Parameters
  • method – The method used for the clustering. The user can choose ‘fcm’ (fuzzy c-means), ‘fst-pso’ (fst-pso based clustering) and ‘gk’ (Gustafson-Kessel).

  • **kwargs – Additional arguments to change settings of the clustering method.

Returns

Tuple containing (centers, partion_matrix, jm)
  • centers: The location of the identified cluster centers.

  • partition_matrix: A matrix containing the cluster memberships of each data point to each of the clusters.

  • jm: Fitness function of the best solution.