// Check if the dynamic frienemy pruning (DFP) should be used used
if self.DFP_mask[clf_index]:
temp_competence = np.multiply(self.C_src[:, clf_index], potential_dists)
competences[clf_index] = np.sum(temp_competence)/sum_potential
return competences
After Change
sum_potential = np.sum(potential_dists, axis=1)
competences = np.einsum("ijk,ij->ik", self.C_src[np.newaxis, :, :], potential_dists)
competences = competences/sum_potential.reshape(-1, 1)
// competences = np.zeros(self.n_classifiers)
// for clf_index in range(self.n_classifiers):
// // Check if the dynamic frienemy pruning (DFP) should be used used