class_docstr: Factorization Machines base class.
docstr: Debugs the output of the FM regressor.
  
  Parameters
  ----------
  x
      A dictionary of features.
  decimals
      The number of decimals use for printing each numeric value.
  
  Returns
  -------
  A table which explains the output.
docstr_tok: ["Debugs","the","output","of","the","FM","regressor",".","Parameters","--","--","--","--","--","x","A","dictionary","of","features",".","decimals","The","number","of","decimals","use","for","printing","each","numeric","value",".","Returns","--","--","--","-","A","table","which","explains","the","output","."]
code: def debug_one(self, x: dict, decimals: int = 5) -> str:
      """Debugs the output of the FM regressor.
  
      Parameters
      ----------
      x
          A dictionary of features.
      decimals
          The number of decimals use for printing each numeric value.
  
      Returns
      -------
      A table which explains the output.
      """
  
      x = self._ohe_cat_features(x)
  
      def fmt_float(x: float) -> str:
          return "{: ,.{prec}f}".format(x, prec=decimals)
  
      names = (
          self._interaction_names(x)  # latents
          + list(map(str, x.keys()))  # weights
          + ["Intercept"]  # intercept
      )
  
      values = list(
          map(
              fmt_float,
              [
                  self._interaction_val(x, combination)
                  for combination in self._interaction_combination_keys(
                      x
                  )
              ]  # latents
              + list(x.values())  # weights
              + [1],  # intercept
          )
      )
  
      weights = list(
          map(
              fmt_float,
              [
                  self._interaction_coefficient(combination)
                  for combination in self._interaction_combination_keys(
                      x
                  )
              ]  # latents
              + [self.weights.get(i, 0) for i in x]  # weights
              + [self.intercept],  # intercept
          )
      )
      contributions = (
          [
              self._interaction_coefficient(combination)
              * self._interaction_val(x, combination)
              for combination in self._interaction_combination_keys(x)
          ]  # latents
          + [
              xi * self.weights.get(i, 0) for i, xi in x.items()
          ]  # weights
          + [self.intercept]  # intercept
      )
      order = list(reversed(np.argsort(contributions)))
      contributions_str = list(map(fmt_float, contributions))
  
      table = utils.pretty.print_table(
          headers=["Name", "Value", "Weight", "Contribution"],
          columns=[names, values, weights, contributions_str],
          order=order,
      )
  
      return table
  
imports: from __future__ import annotations
  import abc
  import collections
  import numbers
  from collections.abc import Iterable
  import numpy
  from river import optim, utils
label_desc: Use image node_id 9 for calling the BaseFM obj's underlying member method code with example usage: obj.debug_one(x, decimals) and returns: table, str