code: def get_top_features(feature_names, coef, top, x=None):
      pos, neg = _get_top_features(feature_names, coef, top, x)
      pos_coef = coef > 0
      neg_coef = coef < 0
      # pos_sum = sum(w for name, w in pos or [['', 0]])
      # neg_sum = sum(w for name, w in neg or [['', 0]])
      return FeatureWeights(
          pos=pos,
          neg=neg,
          pos_remaining=pos_coef.sum() - len(pos),
          neg_remaining=neg_coef.sum() - len(neg),
          # pos_remaining_sum=coef[pos_coef].sum() - pos_sum,
          # neg_remaining_sum=coef[neg_coef].sum() - neg_sum,
      )
  
file_path: eli5/eli5/_feature_weights.py
imports: from __future__ import absolute_import
  import numpy
  from eli5.base import FeatureWeights, FeatureWeight
  from .utils import argsort_k_largest_positive, argsort_k_smallest, mask
label_desc: Use image node_id 2 for calling a global function with example usage: get_top_features(feature_names, coef, top, x) and returns: FeatureWeights