Lazy import of sklearn
-import sklearn.metrics.pairwise
def compute_template_similarity(waveform_extractor, method='cosine_similarity'):
@@ -12,6 +11,8 @@ def compute_template_similarity(waveform_extractor, method='cosine_similarity'):
method: str
Method name
"""
+ import sklearn.metrics.pairwise
+
templates = waveform_extractor.get_all_templates()
s = templates.shape
if method == 'cosine_similarity':
