code: def test_als_train_large_ratings():
      algo = als.ImplicitMF(20, iterations=20, use_ratings=True)
      ratings = lktu.ml_test.ratings
      algo.fit(ratings)
  
      assert len(algo.user_index_) == ratings.user.nunique()
      assert len(algo.item_index_) == ratings.item.nunique()
      assert algo.user_features_.shape == (ratings.user.nunique(), 20)
      assert algo.item_features_.shape == (ratings.item.nunique(), 20)
  
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 13 for calling a global function with example usage: test_als_train_large_ratings() without return types