1002cfbcc9f8182404fb058f959d625de2eabbfc,deslib/dcs/rank.py,Rank,estimate_competence,#Rank#Any#Any#,87

Before Change


            if self.DFP_mask[clf_index]:
                // count the number of correctly classified samples in the
                // neighborhood.
                for counter, index in enumerate(idx_neighbors):
                    if self.processed_dsel[index][clf_index]:
                        continue
                    else:
                        competences[clf_index] = counter
                        break

        return competences

After Change


        
        _, 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)

        // 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/dcs/rank.py
Class Name: Rank
Method Name: estimate_competence


Project Name: GPflow/GPflowOpt
Commit Name: ee97f87f3d19aad4329fb012b2819d13b48c8fa3
Time: 2017-07-28
Author: ivo.couckuyt@ugent.be
File Name: GPflowOpt/pareto.py
Class Name: Pareto
Method Name: pareto2d_bounds


Project Name: pyannote/pyannote-audio
Commit Name: aa7322f6057dce6424af3f2245e4c45bd33af05e
Time: 2017-01-11
Author: bredin@limsi.fr
File Name: scripts/speaker_embedding.py
Class Name:
Method Name: speaker_recognition_xp


Project Name: rodluger/starry
Commit Name: 141903a21846d54aaf09aa95a3bcdd8b673ee116
Time: 2019-02-05
Author: rodluger@gmail.com
File Name: starry/ops/theano_op.py
Class Name: StarryGradOp
Method Name: perform