code: def test_uu_batch_accuracy():
      from lenskit.algorithms import basic
      from lenskit.algorithms import bias
      import lenskit.crossfold as xf
      import lenskit.metrics.predict as pm
  
      ratings = lktu.ml100k.ratings
  
      uu_algo = knn.UserUser(30)
      algo = basic.Fallback(uu_algo, bias.Bias())
  
      folds = xf.partition_users(ratings, 5, xf.SampleFrac(0.2))
      preds = [
          __batch_eval((algo, train, test)) for (train, test) in folds
      ]
      preds = pd.concat(preds)
      mae = pm.mae(preds.prediction, preds.rating)
      assert mae == approx(0.71, abs=0.05)
  
      user_rmse = preds.groupby("user").apply(
          lambda df: pm.rmse(df.prediction, df.rating)
      )
      assert user_rmse.mean() == approx(0.91, abs=0.055)
  
imports: from lenskit.algorithms import Recommender
  import lenskit.algorithms.user_knn
  from lenskit.util import clone
  from pathlib import Path
  import logging
  import pickle
  import pandas
  import numpy
  from scipy.sparse import linalg
  from pytest import approx, mark
  import lenskit.util.test
label_desc: Use image node_id 17 for calling a global function with example usage: test_uu_batch_accuracy() without return types