def distance(self, features, targets):
cost_matrix = np.zeros((len(targets), len(features)))
key_list = list(self.samples.keys())
for i, target_k in enumerate(targets):
target = key_list[i]
cost_matrix[i, :] = self._metric(self.samples[target], features)
return cost_matrix
1