e81142f0869321cd8792e13bfc4f6fb85d9f1efc,libact/query_strategies/uncertainty_sampling.py,UncertaintySampling,make_query,#UncertaintySampling#,62

Before Change


            // therefore, total time complexity is O(NK) + O(NK) + O(NK) + O(N) = O(NK)
            ask_id = np.argmax(1 - np.max(self.model.predict_real(X_pool), 1))

        elif self.method == "sm":  // smallest margin
            // time complexity analysis:
            // O(NK) + O(N)
            prob = self.model.predict_real(X_pool)
            min_margin = np.inf
            for j in range(len(prob)):
                m1_id = np.argmax(prob[j])
                m2_id = np.argmax(np.delete(prob[j], m1_id))
                margin = prob[j][m1_id] - prob[j][m2_id]
                if margin < min_margin:
                    min_margin = margin
                    ask_id = j

        else:
            raise ValueError(
                "Invalid method "%s" (available choices: ("lc", "sm", "le")"
                % self.method
                )

        return unlabeled_entry_ids[ask_id]

    def get_model(self):

After Change


            else:
                // Find 2 largest decision values
                ind = np.partition(-np.abs(dvalue), 2, axis=1)[:2]
            margin = np.abs(np.abs(dvalue[:, ind[0]]) - np.abs(dvalue[:, ind[1]]))
            ask_id = np.argmin(margin)

        return unlabeled_entry_ids[ask_id]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: ntucllab/libact
Commit Name: e81142f0869321cd8792e13bfc4f6fb85d9f1efc
Time: 2015-12-22
Author: yangarbiter@gmail.com
File Name: libact/query_strategies/uncertainty_sampling.py
Class Name: UncertaintySampling
Method Name: make_query


Project Name: prody/ProDy
Commit Name: c0c0e9e18e2538d0a9d14260a2e36031e1122d2c
Time: 2012-10-20
Author: lordnapi@gmail.com
File Name: lib/prody/proteins/pdbclusters.py
Class Name:
Method Name: listPDBCluster


Project Name: mne-tools/mne-python
Commit Name: fa91217b895957c4106d6175e27d72a48f4f05dc
Time: 2019-01-12
Author: jnu@iki.fi
File Name: mne/viz/topo.py
Class Name:
Method Name: _plot_evoked_topo


Project Name: mindsdb/mindsdb
Commit Name: 689393ea00d50b81ed9f5f3af56942d17a6384ae
Time: 2018-10-26
Author: jorge.torres.maldonado@gmail.com
File Name: mindsdb/libs/helpers/norm_denorm_helpers.py
Class Name:
Method Name: norm