зеркало из https://github.com/mozilla/bugbug.git
Apply minimum after reduction
This commit is contained in:
Родитель
d9d2b89f77
Коммит
0bfa7dbdb2
|
@ -585,19 +585,6 @@ class TestSelectModel(Model):
|
|||
if confidence >= confidence_threshold
|
||||
)
|
||||
|
||||
if minimum is not None and len(selected) < minimum:
|
||||
remaining = [
|
||||
(name, confidence)
|
||||
for name, confidence in push["all_possibly_selected"].items()
|
||||
if name not in selected
|
||||
]
|
||||
selected.update(
|
||||
name
|
||||
for name, _ in sorted(remaining, key=lambda x: -x[1])[
|
||||
: minimum - len(selected)
|
||||
]
|
||||
)
|
||||
|
||||
if reduction is not None:
|
||||
if self.granularity == "label":
|
||||
selected = self.reduce(selected, reduction)
|
||||
|
@ -611,6 +598,19 @@ class TestSelectModel(Model):
|
|||
)
|
||||
)
|
||||
|
||||
if minimum is not None and len(selected) < minimum:
|
||||
remaining = [
|
||||
(name, confidence)
|
||||
for name, confidence in push["all_possibly_selected"].items()
|
||||
if name not in selected
|
||||
]
|
||||
selected.update(
|
||||
name
|
||||
for name, _ in sorted(remaining, key=lambda x: -x[1])[
|
||||
: minimum - len(selected)
|
||||
]
|
||||
)
|
||||
|
||||
if cap is not None and len(selected) > cap:
|
||||
selected = set(
|
||||
sorted(
|
||||
|
|
Загрузка…
Ссылка в новой задаче