This commit is contained in:
Marco Castelluccio 2020-06-15 15:02:11 +02:00
Родитель d9d2b89f77
Коммит 0bfa7dbdb2
1 изменённых файлов: 13 добавлений и 13 удалений

Просмотреть файл

@ -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(