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
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: 4
Non-data size: 7
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: AlexsLemonade/refinebio
Commit Name: d691d1b9e1bea69067156faa1a517dc7e0213b17
Time: 2019-03-19
Author: arielsvn@gmail.com
File Name: api/data_refinery_api/views.py
Class Name: Stats
Method Name: _aggregate_nomad_jobs
Project Name: mozilla/bugbug
Commit Name: ed9b2113f9bbe975624783c65eed978c9074aaef
Time: 2020-05-15
Author: mcastelluccio@mozilla.com
File Name: bugbug/models/testselect.py
Class Name: TestSelectModel
Method Name: select_tests
Project Name: pantsbuild/pants
Commit Name: 0a61cf8d34eeee9609c7ff0c5e5f71a623dc1dc8
Time: 2020-07-24
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/core/goals/test.py
Class Name:
Method Name: run_tests