code: def test_als_save_load(tmp_path):
      "Test saving and loading ALS models, and regularized training."
      algo = als.ImplicitMF(
          5, iterations=5, reg=(2, 1), use_ratings=False
      )
      ratings = lktu.ml_test.ratings
      algo.fit(ratings)
  
      fn = tmp_path / "model.bpk"
      binpickle.dump(algo, fn, codec=None)
  
      restored = binpickle.load(fn)
      assert np.all(restored.user_features_ == algo.user_features_)
      assert np.all(restored.item_features_ == algo.item_features_)
      assert np.all(restored.item_index_ == algo.item_index_)
      assert np.all(restored.user_index_ == algo.user_index_)
  
imports: import logging
  from lenskit import util
  from lenskit.algorithms import als
  import pandas
  import numpy
  from scipy import stats
  import binpickle
  from seedbank import numpy_rng
  from pytest import mark, approx
  import lenskit.util.test
  from lenskit.algorithms import Recommender
  from lenskit.util import Stopwatch
label_desc: Use image node_id 11 for calling a global function with example usage: test_als_save_load(tmp_path) without return types