eb3d56286ec27fda764093c9e357b079e3c3a91f,bugbug/model.py,Model,print_feature_importances,#Model#Any#Any#,241

Before Change


        // when classifying
        if class_probabilities is not None:
            // shap_values are stored in class 1 for binary classification
            if len(class_probabilities[0]) != 2:
                predicted_class_index = class_probabilities.argmax(axis=-1)[0]
            else:
                predicted_class_index = 0

            predicted_class = self.class_names[predicted_class_index]
            imp_values = important_features["classes"][predicted_class][0]
            shap_val = []
            top_feature_names = []
            for importance, index, is_positive in imp_values:

After Change


        // when classifying
        if class_probabilities is not None:
            predicted_class_index = class_probabilities.argmax(axis=-1)[0]
            predicted_class = self.le.inverse_transform([predicted_class_index])[0]

            imp_values = important_features["classes"][predicted_class][0]
            shap_val = []
            top_feature_names = []
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: mozilla/bugbug
Commit Name: eb3d56286ec27fda764093c9e357b079e3c3a91f
Time: 2019-11-04
Author: mcastelluccio@mozilla.com
File Name: bugbug/model.py
Class Name: Model
Method Name: print_feature_importances


Project Name: mozilla/bugbug
Commit Name: eb3d56286ec27fda764093c9e357b079e3c3a91f
Time: 2019-11-04
Author: mcastelluccio@mozilla.com
File Name: bugbug/model.py
Class Name: Model
Method Name: classify


Project Name: mozilla/bugbug
Commit Name: eb3d56286ec27fda764093c9e357b079e3c3a91f
Time: 2019-11-04
Author: mcastelluccio@mozilla.com
File Name: bugbug/model.py
Class Name: Model
Method Name: get_important_features