зеркало из https://github.com/mozilla/bugbug.git
Use feature legend in the commit classifier
This commit is contained in:
Родитель
e66eab0ccf
Коммит
3e7c2016cd
|
@ -107,8 +107,6 @@ class CommitClassifier(object):
|
||||||
commits[-1], probabilities=True, importances=True
|
commits[-1], probabilities=True, importances=True
|
||||||
)
|
)
|
||||||
|
|
||||||
feature_names = self.model.get_human_readable_feature_names()
|
|
||||||
|
|
||||||
features = []
|
features = []
|
||||||
for i, (val, feature_index, is_positive) in enumerate(
|
for i, (val, feature_index, is_positive) in enumerate(
|
||||||
importance["importances"]["classes"][1][0]
|
importance["importances"]["classes"][1][0]
|
||||||
|
@ -116,7 +114,7 @@ class CommitClassifier(object):
|
||||||
features.append(
|
features.append(
|
||||||
[
|
[
|
||||||
i + 1,
|
i + 1,
|
||||||
feature_names[int(feature_index)],
|
importance["feature_legend"][str(i + 1)],
|
||||||
f'({"+" if (is_positive) else "-"}{val})',
|
f'({"+" if (is_positive) else "-"}{val})',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче