code: def test_inferer_infer(dataPtr):
      test_data = dataPtr
  
      rowFeatureDim = test_data.get_entity("row").shape[1]
      colFeatureDim = test_data.get_entity("col").shape[1]
      rank = 2
      W = [
          Stiefel(rowFeatureDim, rank).rand(),
          SymmetricPositiveDefinite(rank).rand(),
          Stiefel(colFeatureDim, rank).rand(),
      ]
  
      Inferer(method="dot").infer(test_data, W)
  
      inference = Inferer(method="dot", transformation="mean").infer(
          test_data, W
      )
      nOccurences = collections.Counter(inference.ravel())
      assert nOccurences[0] + nOccurences[1] == inference.size
  
      k = 2
      inference = Inferer(
          method="dot", k=k, transformation="topk"
      ).infer(test_data, W)
      nOccurences = collections.Counter(inference.ravel())
      assert nOccurences[0] + nOccurences[1] == inference.size
      assert np.max(np.count_nonzero(inference == 1, axis=0)) <= k
  
file_path: recommenders/tests/unit/recommenders/models/test_geoimc.py
imports: import collections
  import pytest
  import numpy
  from scipy.sparse import csr_matrix
label_desc: Use image node_id 7 for calling a global function with example usage: test_inferer_infer(dataPtr) without return types