From 3e7c2016cd9f066de8cb7f6b96760eee9451d0a0 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 23 Jul 2019 12:09:28 +0200 Subject: [PATCH] Use feature legend in the commit classifier --- scripts/commit_classifier.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/commit_classifier.py b/scripts/commit_classifier.py index 1042a411..f5baed58 100644 --- a/scripts/commit_classifier.py +++ b/scripts/commit_classifier.py @@ -107,8 +107,6 @@ class CommitClassifier(object): commits[-1], probabilities=True, importances=True ) - feature_names = self.model.get_human_readable_feature_names() - features = [] for i, (val, feature_index, is_positive) in enumerate( importance["importances"]["classes"][1][0] @@ -116,7 +114,7 @@ class CommitClassifier(object): features.append( [ i + 1, - feature_names[int(feature_index)], + importance["feature_legend"][str(i + 1)], f'({"+" if (is_positive) else "-"}{val})', ] )