class_docstr: Factorization Machines base class.
docstr: Calculates greater than unary interactions.
  For normal FM: sigma (i < j) product(latents[xi] * latents[xj]) xi * xj
  interaction_combination_keys: sigma (i < j)
  interaction_val: xi * xj
  interaction_coefficient: latents[xi] * latents[xj]
docstr_tok: ["Calculates","greater","than","unary","interactions",".","For","normal","FM",":","sigma","(","i","<","j",")","product","(","latents","[","xi","]","*","latents","[","xj","]",")","xi","*","xj","interaction_combination_keys",":","sigma","(","i","<","j",")","interaction_val",":","xi","*","xj","interaction_coefficient",":","latents","[","xi","]","*","latents","[","xj","]"]
code: def _calculate_interactions(self, x: dict) -> float:
      """Calculates greater than unary interactions.
      For normal FM: sigma (i < j) product(latents[xi] * latents[xj]) xi * xj
      interaction_combination_keys: sigma (i < j)
      interaction_val: xi * xj
      interaction_coefficient: latents[xi] * latents[xj]
      """
      return sum(
          self._interaction_coefficient(combination)
          * self._interaction_val(x, combination)
          for combination in self._interaction_combination_keys(x)
      )
  
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 8 for calling the BaseFM obj's underlying member method code with example usage: obj._calculate_interactions(x) and returns: sum