1002cfbcc9f8182404fb058f959d625de2eabbfc,deslib/des/knora_e.py,KNORAE,estimate_competence,#KNORAE#,66

Before Change


                      The competence level estimated for each base classifier in the pool
        
        _, idx_neighbors = self._get_region_competence(query)
        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]:
                results_neighbors = self.processed_dsel[idx_neighbors, clf_index]
                indices_errors = np.where(results_neighbors == 0)[0]
                if indices_errors.size != 0:
                    competences[clf_index] = np.min(indices_errors)
                else:
                    competences[clf_index] = self.k
        return competences

    def select(self, competences):
        Selects all base classifiers that obtained a local accuracy of 100% in the region of competence

After Change


                      The competence level estimated for each base classifier in the pool
        
        _, idx_neighbors = self._get_region_competence(query)
        idx_neighbors = np.atleast_2d(idx_neighbors)
        results_neighbors = self.processed_dsel[idx_neighbors, :]

        // Get the shape of the vector in order to know the number of samples, base classifiers and neighbors considered.
        shape = results_neighbors.shape

        // add an row with zero for the case where the base classifier correctly classifies the whole neighborhood.
        // That way the search will always find a zero after comparing to self.K + 1
        addition = np.zeros((shape[0], shape[2]))
        results_neighbors = np.insert(results_neighbors, shape[1], addition, axis=1)
        competences = np.argmax(results_neighbors == 0, axis=1)

        // indices_errors = np.where(results_neighbors == 0)[0]
        // competences = np.zeros(self.n_classifiers)
        //
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 6

Non-data size: 15

Instances


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: 1002cfbcc9f8182404fb058f959d625de2eabbfc
Time: 2018-03-22
Author: rafaelmenelau@gmail.com
File Name: deslib/des/knora_u.py
Class Name: KNORAU
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/des_p.py
Class Name: DESP
Method Name: estimate_competence


Project Name: scikit-learn-contrib/DESlib
Commit Name: 1002cfbcc9f8182404fb058f959d625de2eabbfc
Time: 2018-03-22
Author: rafaelmenelau@gmail.com
File Name: deslib/dcs/ola.py
Class Name: OLA
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: 1002cfbcc9f8182404fb058f959d625de2eabbfc
Time: 2018-03-22
Author: rafaelmenelau@gmail.com
File Name: deslib/des/knop.py
Class Name: KNOP
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