code: def test_fsvd_save_load():
      ratings = lktu.ml_test.ratings
  
      original = svd.FunkSVD(20, iterations=20)
      original.fit(ratings)
  
      assert original.bias.mean_ == approx(ratings.rating.mean())
      assert original.item_features_.shape == (
          ratings.item.nunique(),
          20,
      )
      assert original.user_features_.shape == (
          ratings.user.nunique(),
          20,
      )
  
      mod = pickle.dumps(original)
      _log.info("serialized to %d bytes", len(mod))
      algo = pickle.loads(mod)
  
      assert algo.bias.mean_ == original.bias.mean_
      assert np.all(
          algo.bias.user_offsets_ == original.bias.user_offsets_
      )
      assert np.all(
          algo.bias.item_offsets_ == original.bias.item_offsets_
      )
      assert np.all(algo.user_features_ == original.user_features_)
      assert np.all(algo.item_features_ == original.item_features_)
      assert np.all(algo.item_index_ == original.item_index_)
      assert np.all(algo.user_index_ == original.user_index_)
  
file_path: lkpy/tests/test_funksvd.py
imports: import logging
  import pickle
  from pathlib import Path
  import lenskit.algorithms.funksvd
  import pandas
  import numpy
  from pytest import approx, mark
  import lenskit.util.test
label_desc: Use image node_id 9 for calling a global function with example usage: test_fsvd_save_load() without return types