From 5b055fd413e097d91bfec59f6a29d43a7e137bca Mon Sep 17 00:00:00 2001 From: Alastair Porter Date: Mon, 16 Oct 2023 16:33:17 +0200 Subject: [PATCH] fix undefined name --- clustering/clustering.py | 4 ++-- sounds/models.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clustering/clustering.py b/clustering/clustering.py index bbd509e95..607c39099 100644 --- a/clustering/clustering.py +++ b/clustering/clustering.py @@ -104,7 +104,7 @@ def _average_mutual_information_reference_features_clusters(self, partition): Returns: Numpy.float: Average Mutual Information. """ - reference_features, clusters = self._prepare_clustering_result_and_reference_features_for_evaluation(classes) + reference_features, clusters = self._prepare_clustering_result_and_reference_features_for_evaluation(partition) return np.average(mutual_info_classif(reference_features, clusters, discrete_features=True)) def _silouhette_coeff_reference_features_clusters(self, partition): @@ -116,7 +116,7 @@ def _silouhette_coeff_reference_features_clusters(self, partition): Returns: Numpy.float: mean Silhouette Coefficient. """ - reference_features, clusters = self._prepare_clustering_result_and_reference_features_for_evaluation(classes) + reference_features, clusters = self._prepare_clustering_result_and_reference_features_for_evaluation(partition) return metrics.silhouette_score(reference_features, clusters, metric='euclidean') def _calinski_idx_reference_features_clusters(self, partition): diff --git a/sounds/models.py b/sounds/models.py index 7fe8bb556..3b870a016 100644 --- a/sounds/models.py +++ b/sounds/models.py @@ -1768,7 +1768,7 @@ def get_pack_tags_bw(self): return [{ 'name': tag, 'count': count, - 'browse_url': browse_pack_tag_url(tag) + 'browse_url': self.browse_pack_tag_url(tag) } for tag, count in pack_tags_counts] except SearchEngineException as e: return []