code: def adapter_evaluator(algo):
      recommendation_indexer = RecommendationIndexer(
          userInputCol=USER_ID,
          userOutputCol=USER_ID_INDEX,
          itemInputCol=ITEM_ID,
          itemOutputCol=ITEM_ID_INDEX,
      )
  
      adapter = RankingAdapter(mode="allUsers", k=5, recommender=algo)
      pipeline = Pipeline(stages=[recommendation_indexer, adapter])
      output = pipeline.fit(ratings).transform(ratings)
      print(str(output.take(1)) + "\n")
  
      metrics = ["ndcgAt", "fcp", "mrr"]
      for metric in metrics:
          print(
              metric
              + ": "
              + str(
                  RankingEvaluator(k=3, metricName=metric).evaluate(
                      output
                  )
              ),
          )
  
file_path: SynapseML/core/src/test/python/synapsemltest/recommendation/test_ranking.py
imports: import unittest
  from synapse.ml.recommendation import RankingAdapter
  from synapse.ml.recommendation import RankingEvaluator
  from synapse.ml.recommendation import RankingTrainValidationSplit
  from synapse.ml.recommendation import RecommendationIndexer
  from synapse.ml.recommendation import SAR
  from synapsemltest.spark import *
  from pyspark.ml import Pipeline
  from pyspark.ml.feature import StringIndexer
  from pyspark.ml.recommendation import ALS
  from pyspark.ml.tuning import ParamGridBuilder
label_desc: Use image node_id 1 for calling the RankingSpec obj's underlying member method code with example usage: obj.adapter_evaluator(algo) without return types