44bdf9be3b913a1a0e90115e45edbee192d01b90,deslib/des/probabilistic.py,Probabilistic,estimate_competence,#Probabilistic#Any#Any#,113
Before Change
potential_dists = self.potential_func(dists_organized)
sum_potential = np.sum(potential_dists)
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
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
def select(self, competences):
Selects the base classifiers that obtained a competence level higher than the predefined threshold.
After Change
// TODO: Adapt this function to batch processing
dists, idx_neighbors = self._get_region_competence(query)
idx_neighbors = np.atleast_2d(idx_neighbors)
dists = np.atleast_2d(dists)
dists_organized = np.take(dists, idx_neighbors)
//dists_organized = np.array([dists[index] for index in np.argsort(idx_neighbors)])
potential_dists = self.potential_func(dists_organized)
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
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 15
Instances
Project Name: scikit-learn-contrib/DESlib
Commit Name: 44bdf9be3b913a1a0e90115e45edbee192d01b90
Time: 2018-03-31
Author: rafaelmenelau@gmail.com
File Name: deslib/des/probabilistic.py
Class Name: Probabilistic
Method Name: estimate_competence
Project Name: scikit-learn-contrib/DESlib
Commit Name: 1002cfbcc9f8182404fb058f959d625de2eabbfc
Time: 2018-03-22
Author: rafaelmenelau@gmail.com
File Name: deslib/des/knora_e.py
Class Name: KNORAE
Method Name: estimate_competence
Project Name: scikit-learn-contrib/DESlib
Commit Name: 4abda80dd12518e6bfdc44d067566a3e6947e906
Time: 2018-03-28
Author: rafaelmenelau@gmail.com
File Name: deslib/dcs/a_priori.py
Class Name: APriori
Method Name: estimate_competence
Project Name: scikit-learn-contrib/DESlib
Commit Name: 44bdf9be3b913a1a0e90115e45edbee192d01b90
Time: 2018-03-31
Author: rafaelmenelau@gmail.com
File Name: deslib/des/probabilistic.py
Class Name: Probabilistic
Method Name: estimate_competence