Evaluation

The coclust.evaluation module provides functions to evaluate the results of clustering or co-clustering algorithms.

Internal measures

The coclust.evaluation.internal module provides functions to evaluate clustering or co-clustering given internal criteria.

coclust.evaluation.internal.best_modularity_partition(in_data, nbr_clusters_range, n_rand_init=1)[source]

Evaluate the best partition over a range of number of cluster using co-clustering by direct maximization of graph modularity.

Parameters:
  • in_data (numpy array or scipy sparse matrix, shape=(n_samples, n_features)) – Matrix to be analyzed
  • nbr_clusters_range – Number of clusters to be evaluated
  • n_rand_init – Number of time the algorithm will be run with different initializations
Returns:

  • tmp_best_model (coclust.coclustering.CoclustMod) – model with highest final modularity
  • tmp_max_modularities (list) – final modularities for all evaluated partitions

External measures

The coclust.evaluation.external module provides functions to evaluate clustering or co-clustering results with external information such as the true labeling of the clusters.

coclust.evaluation.external.accuracy(true_row_labels, predicted_row_labels)[source]

Get the best accuracy.

Parameters:
  • true_row_labels (array-like) – The true row labels, given as external information
  • predicted_row_labels (array-like) – The row labels predicted by the model
Returns:

Best value of accuracy

Return type:

float