code: def test_sklearn_crfsuite(xseq, yseq):
      crf = CRF(c1=0.0, c2=0.1, max_iterations=50)
      crf.fit([xseq], [yseq])
  
      expl = explain_weights(crf)
      text, html = format_as_all(expl, crf)
  
      assert "y='sunny' top features" in text
      assert "y='rainy' top features" in text
      assert "Transition features" in text
      assert "sunny   -0.130    0.696" in text
      assert "+0.124  солнце:не светит" in text
  
      html_nospaces = html.replace(" ", "").replace("\n", "")
      assert "солнце:не светит" in html
      assert "<th>rainy</th><th>sunny</th>" in html_nospaces
  
      try:
          from eli5 import format_as_dataframe, format_as_dataframes
      except ImportError:
          pass
      else:
          from .test_formatters_as_dataframe import (
              check_targets_dataframe,
          )
  
          df_dict = format_as_dataframes(expl)
          check_targets_dataframe(df_dict["targets"], expl)
          df_transition = df_dict["transition_features"]
          assert list(df_transition.columns) == ["from", "to", "coef"]
          df_indexed = df_transition.groupby(["from", "to"]).agg(
              lambda x: x
          )
          transition = expl.transition_features
          print(df_indexed)
          assert list(transition.class_names) == ["rainy", "sunny"]
          assert np.isclose(
              df_indexed.loc["rainy", "rainy"].coef,
              transition.coef[0, 0],
          )
          assert np.isclose(
              df_indexed.loc["rainy", "sunny"].coef,
              transition.coef[0, 1],
          )
          assert np.isclose(
              df_indexed.loc["sunny", "rainy"].coef,
              transition.coef[1, 0],
          )
  
file_path: eli5/tests/test_sklearn_crfsuite.py
imports: from __future__ import absolute_import, print_function
  import re
  import pytest
  import numpy
  from sklearn_crfsuite import CRF
  from eli5 import explain_weights
  from .utils import format_as_all
label_desc: Use image node_id 3 for calling a global function with example usage: test_sklearn_crfsuite(xseq, yseq) without return types