target_3d = np.expand_dims(self.DSEL_target[idx_neighbors], axis=2)
// Create a mask to remove the neighbors belonging to a different class than the predicted by the base classifier
mask = (predictions_3d != target_3d)
masked_preprocessed = np.ma.MaskedArray(self.processed_dsel[idx_neighbors, :], mask=mask)
competences_masked = np.mean(masked_preprocessed, axis=1)
// Fill 0 to the masked values in the resulting array (when no neighbors belongs to the class predicted by
// the corresponding base classifier)
competences = np.ma.filled(competences_masked, 0)
return competences