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

Before Change


            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: 4

Non-data size: 6

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: arviz-devs/arviz
Commit Name: 32692a1ae53d7c5bf36564aeca1b572ddf40f9f0
Time: 2018-06-29
Author: aloctavodia@gmail.com
File Name: arviz/stats/stats.py
Class Name:
Method Name: r2_score


Project Name: librosa/librosa
Commit Name: 9dcc84c4e9b1fb55e029435dd5e34c9be4bd21f9
Time: 2015-02-15
Author: brian.mcfee@nyu.edu
File Name: librosa/feature/utils.py
Class Name:
Method Name: stack_memory


Project Name: librosa/librosa
Commit Name: 864e5a68de205bca41a2f4b706c5542e9a5b45e5
Time: 2015-02-14
Author: brian.mcfee@nyu.edu
File Name: librosa/feature/utils.py
Class Name:
Method Name: sync