code: def crf_transition_coef(crf):
      n_classes = len(crf.classes_)
      coef = np.empty((n_classes, n_classes))
  
      for i, cls_from in enumerate(crf.classes_):
          for j, cls_to in enumerate(crf.classes_):
              w = crf.transition_features_.get((cls_from, cls_to), 0)
              coef[i, j] = w
  
      return coef
  
file_path: eli5/eli5/sklearn_crfsuite/explain_weights.py
imports: from __future__ import absolute_import
  import numpy
  from scipy import sparse
  from sklearn_crfsuite import CRF
  from eli5.base import Explanation, TargetExplanation, TransitionFeatureWeights
  from eli5.explain import explain_weights
  from eli5.utils import get_target_display_names
  from eli5._feature_names import FeatureNames
  from eli5._feature_weights import get_top_features
label_desc: Use image node_id 3 for calling a global function with example usage: crf_transition_coef(crf) and returns: coef