target = self.DSEL_target[index]
// get the post_prob for the correct class
//post_prob = self._get_scores_dsel(clf_index, index)[target]
post_prob = self.dsel_scores[index, clf_index, target]
result[counter] = (post_prob * dists_normalized[counter])
After Change
scores_target_class = self.dsel_scores[idx_neighbors, :, self.DSEL_target[idx_neighbors]]
// Multiply the scores obtained for the correct class to the distances of each corresponding neighbor
scores_target_class *= np.expand_dims(dists_normalized, axis=2)
// Sum the scores obtained for each neighbor and divide by the sum of all distances
competences = np.sum(scores_target_class, axis=1)/ np.sum(dists_normalized, axis=1)
// competences = np.zeros(self.n_classifiers)
// for clf_index in range(self.n_classifiers):
//