f16992b25bb153df3ab87c5111db2a101cf68c73,bugbug/models/testselect.py,TestSelectModel,train_test_split,#TestSelectModel#Any#Any#,91
Before Change
// according to time: we train on older pushes and evaluate on newer pushes.
def train_test_split(self, X, y):
pushes = OrderedDict()
for test_data in test_scheduling.get_test_scheduling_history(self.granularity):
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
// To properly test the performance of our model, we need to split the data
// 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]
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
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: streamlit/streamlit
Commit Name: 536c65f1fe2e1dc5fb64e278fd95d23f968a2599
Time: 2018-11-23
Author: adrien.g.treuille@gmail.com
File Name: examples/run_all_examples.py
Class Name:
Method Name:
Project Name: streamlit/streamlit
Commit Name: 04519f15e750d1508c5c6bd6888210bdce348802
Time: 2018-11-23
Author: adrien.g.treuille@gmail.com
File Name: examples/run_all_examples.py
Class Name:
Method Name: