evaluator_clustering#
Source code: sensai/evaluation/evaluator_clustering.py
- class ClusteringModelEvaluator(*args, **kwds)[source]#
Bases:
MetricsDictProvider
,Generic
[TClusteringEvalStats
],ABC
- abstract eval_model(model: EuclideanClusterer, **kwargs) TClusteringEvalStats [source]#
- class ClusteringModelUnsupervisedEvaluator(datapoints)[source]#
Bases:
ClusteringModelEvaluator
[ClusteringUnsupervisedEvalStats
]- eval_model(model: EuclideanClusterer, fit=True)[source]#
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:
ClusteringModelEvaluator
[ClusteringSupervisedEvalStats
]- 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: EuclideanClusterer, fit=True)[source]#
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