code: def decision_function_order_4(self, input_type, use_diag=False):
      # Explanation for init_std=1.0.
      # With small init_std the contribution of higher order terms is
      # neglectable, so we would essentially test only low-order implementation.
      # That's why a relatively high init_std=1.0 here.
      model = TFFMClassifier(
          order=4,
          rank=10,
          optimizer=tf.train.AdamOptimizer(learning_rate=0.1),
          n_epochs=0,
          input_type=input_type,
          init_std=1.0,
          seed=0,
          use_diag=use_diag,
      )
  
      if input_type == "dense":
          X = self.X
      else:
          X = sp.csr_matrix(self.X)
  
      model.fit(X, self.y)
      b = model.intercept
      w = model.weights
  
      desired = self.bruteforce_inference(
          self.X, w, b, use_diag=use_diag
      )
  
      actual = model.decision_function(X)
      model.destroy()
  
      np.testing.assert_almost_equal(actual, desired, decimal=4)
  
file_path: tffm/test.py
imports: import unittest
  import numpy
  from tffm import TFFMClassifier
  from scipy import sparse
  import tensorflow
  import pickle
label_desc: Use image node_id 2 for calling the TestFM obj's underlying member method code with example usage: obj.decision_function_order_4(input_type, use_diag) without return types