(fid_mapping, feature_importances)
return new_fi
replace feature id by real feature name
replace feature id by real feature name
replace feature id by real feature name
def make_readable_feature_importance(fid_mapping, feature_importances):
        """
        replace feature id by real feature name
        """
        new_fi = {}
        for id_ in feature_importances:

            if type(id_) == tuple:
                if consts.GUEST in id_[0]:
                    new_fi[fid_mapping[id_[1]]] = feature_importances[id_].importance
                else:
                    role, party_id = id_[0].split(':')
                    new_fi[generate_anonymous(role=role, fid=id_[1], party_id=party_id)] = feature_importances[id_].importance
            else:
                new_fi[fid_mapping[id_]] = feature_importances[id_].importance

        return new_fi
def make_readable_feature_importance ( fid_mapping , feature_importances ) : new_fi = { } for id_ in feature_importances : if type ( id_ ) == tuple : if consts . GUEST in id_ [ 0 ] : new_fi [ fid_mapping [ id_ [ 1 ] ] ] = feature_importances [ id_ ] . importance else : role , party_id = id_ [ 0 ] . split ( ':' ) new_fi [ generate_anonymous ( role = role , fid = id_ [ 1 ] , party_id = party_id ) ] = feature_importances [ id_ ] . importance else : new_fi [ fid_mapping [ id_ ] ] = feature_importances [ id_ ] . importance return new_fi