code: def test_als_predict_basic_for_new_user_with_new_ratings():
      """
      Test if ImplicitMF predictions using the same ratings for a new user
      is the same as a user in the current simple_df dataset.
      """
      u = 10
      i = 3
  
      algo = als.ImplicitMF(20, iterations=10, use_ratings=True)
      algo.fit(simple_dfr)
  
      preds = algo.predict_for_user(u, [i])
  
      new_u_id = 1
      new_ratings = pd.Series(
          [4.0, 5.0], index=[1, 2]
      )  # items as index and ratings as values
  
      new_preds = algo.predict_for_user(new_u_id, [i], new_ratings)
      assert abs(preds.loc[i] - new_preds.loc[i]) <= 0.1
  
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 4 for calling a global function with example usage: test_als_predict_basic_for_new_user_with_new_ratings() without return types