class_docstr: Mixin to test a bunch of common functionality in models
  deriving from RecommenderBase
code: def test_serialization(self):
      likes = get_checker_board(50)
  
      model = self._get_model()
      model.fit(likes, show_progress=False)
  
      with tempfile.TemporaryDirectory() as tmpdir:
          filename = os.path.join(tmpdir, "model.npz")
          model.save(filename)
          reloaded = model.load(filename)
  
          assert_array_equal(
              model.similar_items(1)[0], reloaded.similar_items(1)[0]
          )
          assert_array_equal(
              model.similar_items(1)[1], reloaded.similar_items(1)[1]
          )
  
      # also make  sure we can save/load with file objects instead of filenames
      with tempfile.TemporaryDirectory() as tmpdir:
          with open(os.path.join(tmpdir, "model.npz"), "wb+") as f:
              model.save(f)
              f.seek(0)
              reloaded = model.load(f)
              assert_array_equal(
                  model.similar_items(1)[0],
                  reloaded.similar_items(1)[0],
              )
              assert_array_equal(
                  model.similar_items(1)[1],
                  reloaded.similar_items(1)[1],
              )
  
imports: import os
  import pickle
  import random
  import tempfile
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from scipy.sparse import coo_matrix, csr_matrix
  from implicit.evaluation import precision_at_k
  from implicit.nearest_neighbours import ItemItemRecommender
  from implicit.utils import ParameterWarning
label_desc: Use image node_id 21 for calling the RecommenderBaseTestMixin obj's underlying member method code with example usage: obj.test_serialization() without return types