f16992b25bb153df3ab87c5111db2a101cf68c73,bugbug/models/testselect.py,TestSelectModel,train_test_split,#TestSelectModel#Any#Any#,91
Before Change
rev = test_data["revs"][0]
name = test_data["name"]
if self.granularity == "label" and not name.startswith("test-"):
continue
if rev in pushes:
pushes[rev] += 1
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(
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:]
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
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: ntucllab/libact
Commit Name: 490f25c50a604cb0a53516f4f58dd98cdc379716
Time: 2017-02-06
Author: yangarbiter@gmail.com
File Name: libact/query_strategies/multilabel/multilable_with_auxiliary_learner.py
Class Name: MultilabelWithAuxiliaryLearner
Method Name: make_query
Project Name: nilmtk/nilmtk
Commit Name: 7f007ac656dc5d24606f06544d11dc50748324ef
Time: 2014-05-01
Author: jack-list@xlk.org.uk
File Name: nilmtk/pipeline/energynode.py
Class Name: EnergyNode
Method Name: process