cd1a5446ce793d09f28d021c466a279301eb51f0,deslib/des/meta_des.py,METADES,estimate_competence,#METADES#Any#Any#,315

Before Change


        
        _, idx_neighbors = self._get_region_competence(query)
        _, idx_neighbors_op = self._get_similar_out_profiles(query)
        vectors = []
        for clf_index, clf in enumerate(self.pool_classifiers):
            // Check if the dynamic frienemy pruning (DFP) should be used used
                vectors.append(self.compute_meta_features(query, idx_neighbors, idx_neighbors_op, clf, clf_index))

        vectors = np.array(vectors)
        if isinstance(self.meta_classifier, MultinomialNB):
            vectors = np.digitize(vectors, self.bins)

        // Get the probability for class 1 (Competent)

After Change


        // Digitize the data if a Multinomial NB is used as the meta-classifier
        if isinstance(self.meta_classifier, MultinomialNB):

            meta_feature_vectors = np.digitize(meta_feature_vectors, np.linspace(0.1, 1, 10))

        // Get the probability for class 1 (Competent)
        competences = self.meta_classifier.predict_proba(meta_feature_vectors)[:, 1]

        // Reshape the array from 1D [n_samples x n_classifiers] to 2D [n_samples, n_classifiers]
        competences = competences.reshape(-1, self.n_classifiers)
        if self.DFP:
            competences = competences * self.DFP_mask

        return competences
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: scikit-learn-contrib/DESlib
Commit Name: cd1a5446ce793d09f28d021c466a279301eb51f0
Time: 2018-04-01
Author: rafaelmenelau@gmail.com
File Name: deslib/des/meta_des.py
Class Name: METADES
Method Name: estimate_competence


Project Name: statsmodels/statsmodels
Commit Name: 594882a5c0da72e0175319ea7cb07d373687ff18
Time: 2020-07-22
Author: kevin.k.sheppard@gmail.com
File Name: statsmodels/graphics/gofplots.py
Class Name:
Method Name: _fmt_probplot_axis


Project Name: tensorflow/tensorboard
Commit Name: 8e5c969aa4113b93dfa43d6075ad3bb8eb500f4a
Time: 2017-08-15
Author: wchargin@gmail.com
File Name: tensorboard/data_compat_test.py
Class Name: MigrateValueTest
Method Name: test_audio


Project Name: danforthcenter/plantcv
Commit Name: 96c26bd09d02bb9cddbc083c75ba2ea65b5d377a
Time: 2020-07-16
Author: noahfahlgren@gmail.com
File Name: plantcv/plantcv/color_palette.py
Class Name:
Method Name: color_palette