evaluator_clustering

class ClusteringModelEvaluator(*args, **kwds)[source]

Bases: sensai.evaluation.evaluator.MetricsDictProvider, Generic[sensai.evaluation.evaluator_clustering.TClusteringEvalStats], abc.ABC

abstract eval_model(model: sensai.clustering.clustering_base.EuclideanClusterer, **kwargs) sensai.evaluation.evaluator_clustering.TClusteringEvalStats
class ClusteringModelUnsupervisedEvaluator(datapoints)[source]

Bases: sensai.evaluation.evaluator_clustering.ClusteringModelEvaluator[sensai.evaluation.eval_stats.eval_stats_clustering.ClusteringUnsupervisedEvalStats]

__init__(datapoints)
eval_model(model: sensai.clustering.clustering_base.EuclideanClusterer, fit=True)

Retrieve evaluation statistics holder for the clustering model

Parameters
  • model

  • fit – whether to fit on the evaluator’s data before retrieving statistics. Set this to False if the model you wish to evaluate was already fitted on the desired dataset

Returns

instance of ClusteringUnsupervisedEvalStats that can be used for calculating various evaluation metrics

class ClusteringModelSupervisedEvaluator(datapoints, true_labels: Sequence[int], noise_label=- 1)[source]

Bases: sensai.evaluation.evaluator_clustering.ClusteringModelEvaluator[sensai.evaluation.eval_stats.eval_stats_clustering.ClusteringSupervisedEvalStats]

__init__(datapoints, true_labels: Sequence[int], noise_label=- 1)
Parameters
  • datapoints

  • true_labels – labels of the true clusters, including the noise clusters.

  • noise_label – label of the noise cluster (if there is one) in the true labels

eval_model(model: sensai.clustering.clustering_base.EuclideanClusterer, fit=True)

Retrieve evaluation statistics holder for the clustering model

Parameters
  • model

  • fit – whether to fit on the evaluator’s data before retrieving statistics. Set this to False if the model you wish to evaluate was already fitted on the desired dataset

Returns

instance of ClusteringSupervisedEvalStats that can be used for calculating various evaluation metrics