f16992b25bb153df3ab87c5111db2a101cf68c73,bugbug/models/testselect.py,TestSelectModel,train_test_split,#TestSelectModel#Any#Any#,91

Before Change


            else:
                pushes[rev] = 1

        train_push_len = math.floor(0.9 * len(pushes))
        train_pushes = list(pushes.values())[:train_push_len]
        train_len = sum(count for count in train_pushes)
        print(
            f"{train_push_len} pushes in the training set (corresponding to {train_len} push/jobs)"

After Change


    // according to time: we train on older pushes and evaluate on newer pushes.
    def train_test_split(self, X, y):
        pushes, train_push_len = self.get_pushes()
        train_len = sum(
            len(push["failures"]) + len(push["passes"])
            for push in pushes[:train_push_len]
        )
        print(
            f"{train_push_len} pushes in the training set (corresponding to {train_len} push/jobs)"
        )
        return X[:train_len], X[train_len:], y[:train_len], y[train_len:]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: mozilla/bugbug
Commit Name: f16992b25bb153df3ab87c5111db2a101cf68c73
Time: 2020-04-09
Author: mcastelluccio@mozilla.com
File Name: bugbug/models/testselect.py
Class Name: TestSelectModel
Method Name: train_test_split


Project Name: hls-fpga-machine-learning/hls4ml
Commit Name: 6d27701311a5d0f013cf608dc5947e2fd0813882
Time: 2020-05-04
Author: sioni.summers10@imperial.ac.uk
File Name: hls4ml/model/hls_model.py
Class Name: WeightVariable
Method Name: update_precision


Project Name: ncullen93/torchsample
Commit Name: a7d92f7020dfe8854430ef13ed2923b2606a6262
Time: 2017-05-11
Author: ncullen.th@dartmouth.edu
File Name: torchsample/utils.py
Class Name:
Method Name: th_random_choice


Project Name: tensorflow/magenta
Commit Name: 422678c8bf45574bb7c8a87ba434c455f9f7b877
Time: 2018-07-26
Author: iansimon@users.noreply.github.com
File Name: magenta/music/chord_inference.py
Class Name:
Method Name: sequence_note_pitch_vectors