class_docstr: SAR implementation for PySpark.
docstr: Recommend top K items for all users which are in the test set.
  
  Args:
      test (pyspark.sql.DataFrame): test Spark dataframe.
      top_k (int): top n items to return.
      remove_seen (bool): remove items test users have already
          seen in the past from the recommended set.
      use_cache (bool): use specified local directory stored in
          `self.cache_path` as cache for C++ based fast
          predictions.
      n_user_prediction_partitions (int): prediction partitions.
  
  Returns:
      pyspark.sql.DataFrame: Spark dataframe with recommended items
docstr_tok: ["Recommend","top","K","items","for","all","users","which","are","in","the","test","set",".","Args",":","test","(","pyspark.sql.DataFrame",")",":","test","Spark","dataframe",".","top_k","(","int",")",":","top","n","items","to","return",".","remove_seen","(","bool",")",":","remove","items","test","users","have","already","seen","in","the","past","from","the","recommended","set",".","use_cache","(","bool",")",":","use","specified","local","directory","stored","in","`","self.cache_path","`","as","cache","for","C++","based","fast","predictions",".","n_user_prediction_partitions","(","int",")",":","prediction","partitions",".","Returns",":","pyspark.sql.DataFrame",":","Spark","dataframe","with","recommended","items"]
code: def recommend_k_items(
      self,
      test,
      top_k=10,
      remove_seen=True,
      use_cache=False,
      n_user_prediction_partitions=200,
  ):
      """Recommend top K items for all users which are in the test set.
  
      Args:
          test (pyspark.sql.DataFrame): test Spark dataframe.
          top_k (int): top n items to return.
          remove_seen (bool): remove items test users have already
              seen in the past from the recommended set.
          use_cache (bool): use specified local directory stored in
              `self.cache_path` as cache for C++ based fast
              predictions.
          n_user_prediction_partitions (int): prediction partitions.
  
      Returns:
          pyspark.sql.DataFrame: Spark dataframe with recommended items
      """
      if not use_cache:
          return self._recommend_k_items_slow(test, top_k, remove_seen)
      elif self.cache_path is not None:
          return self._recommend_k_items_fast(
              test, top_k, remove_seen, n_user_prediction_partitions
          )
      else:
          raise ValueError("No cache_path specified")
  
file_path: recommenders/contrib/sarplus/python/pysarplus/SARPlus.py
imports: import logging
  import pandas
  from pyspark.sql.types import StructType, StructField, IntegerType, FloatType
  from pyspark.sql.functions import pandas_udf, PandasUDFType
  from pysarplus import SARModel
  import pyspark.sql.functions
label_desc: Use image node_id 7 for calling the SARPlus obj's underlying member method code with example usage: obj.recommend_k_items(test, top_k, remove_seen, use_cache, n_user_prediction_partitions) and returns: self, self