gemseo.mlearning.clustering.quality.base_clusterer_quality module#

The base class to assess the quality of a clusterer.

class BaseClustererQuality(algo, fit_transformers=True)[source]#

Bases: BaseMLAlgoQuality

The base class to assess the quality of a clusterer.

Parameters:
  • algo (BaseClusterer) -- A machine learning algorithm for clustering.

  • fit_transformers (bool) --

    Whether to re-fit the transformers when using resampling techniques. If False, use the transformers of the algorithm fitted from the whole training dataset.

    By default it is set to True.

compute_learning_measure(samples=(), multioutput=True)[source]#

Evaluate the quality of the ML model from the training dataset.

Parameters:
  • samples (Sequence[int]) --

    The indices of the learning samples. If empty, use the whole training dataset.

    By default it is set to ().

  • multioutput (bool) --

    Whether the quality measure is returned for each component of the outputs. Otherwise, the average quality measure.

    By default it is set to True.

Returns:

The quality of the ML model.

Return type:

MeasureType

algo: BaseClusterer#

The machine learning algorithm whose quality we want to measure.