Skip to content

Commit

Permalink
fix undefined name
Browse files Browse the repository at this point in the history
  • Loading branch information
alastair committed Dec 20, 2023
1 parent 6ea5c5a commit 73395bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions clustering/clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,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):
Expand All @@ -115,7 +115,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):
Expand Down
2 changes: 1 addition & 1 deletion sounds/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,7 @@ def get_pack_tags_bw(self):
return self.pack_tags # If precomputed from PackManager.bulk_query_id method
else:
pack_tags_counts = get_search_engine().get_pack_tags(self.user.username, self.name)
return [{'name': tag, 'count': count, 'browse_url': browse_pack_tag_url(tag)}
return [{'name': tag, 'count': count, 'browse_url': self.browse_pack_tag_url(tag)}
for tag, count in pack_tags_counts]
except SearchEngineException as e:
return []
Expand Down

0 comments on commit 73395bf

Please sign in to comment.