283ecdfd495c8d5256c5ab07b470f36270d7f4a8,snorkel/learning/gen_learning.py,GenerativeModel,train,#GenerativeModel#,70

Before Change


        self.cardinalities = self.cardinality * np.ones(m, dtype=np.int64)
        self.candidate_ranges = candidate_ranges
        if candidate_ranges is not None:
            for i in range(m):
                c_range = candidate_ranges[i]

                // Confirm that the candidate range has only unique values
                assert len(c_range) == len(set(c_range))
                self.cardinalities[i] = len(c_range)

                // Re-map the values of L[i, :]
                // Assumes L is csr_sparse format at this point
                for j in range(L[i].data.shape[0]):
                    val = L[i].data[j]
                    if val not in c_range:
                        raise ValueError(Value {0} is not in supplied range 
                            for candidate at index {1}.format(val, i))
                    L[i, L[i].indices[j]] = c_range.index(val) + 1

        // Shuffle the data points, cardinalities, and candidate_ranges
        idxs = range(m)
        np.random.shuffle(idxs)
        L = L[idxs, :]
        if candidate_ranges is not None:

After Change


        self.cardinalities = self.cardinality * np.ones(m, dtype=np.int64)
        self.candidate_ranges = candidate_ranges
        if self.candidate_ranges is not None:
            L, self.cardinalities, _ = self._remap_scoped_categoricals(L, 
                self.candidate_ranges)

        // Shuffle the data points, cardinalities, and candidate_ranges
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: snorkel-team/snorkel
Commit Name: 283ecdfd495c8d5256c5ab07b470f36270d7f4a8
Time: 2017-07-22
Author: ajratner@gmail.com
File Name: snorkel/learning/gen_learning.py
Class Name: GenerativeModel
Method Name: train


Project Name: mittagessen/kraken
Commit Name: 6e6c12425a787d8c954ce5c31ceed59cdd531001
Time: 2018-05-20
Author: mittagessen@l.unchti.me
File Name: kraken/lib/ctc_decoder.py
Class Name:
Method Name: greedy_decoder


Project Name: snorkel-team/snorkel
Commit Name: 283ecdfd495c8d5256c5ab07b470f36270d7f4a8
Time: 2017-07-22
Author: ajratner@gmail.com
File Name: snorkel/learning/gen_learning.py
Class Name: GenerativeModel
Method Name: train


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