class_docstr: Spark Ranking Evaluator
class_docstr_tok: ["Spark","Ranking","Evaluator"]
docstr: Get precision@k.
  
  .. note::
      More details can be found
      `here <http://spark.apache.org/docs/2.1.1/api/python/pyspark.mllib.html#pyspark.mllib.evaluation.RankingMetrics.precisionAt>`_.
  
  Return:
      float: precision at k (min=0, max=1)
docstr_tok: ["Get","precision","@","k.","..","note",":",":","More","details","can","be","found","`","here","<","http",":","\/\/spark.apache.org\/docs\/2.1.1\/api\/python\/pyspark.mllib.html","#","pyspark.mllib.evaluation.RankingMetrics.precisionAt",">","`","_",".","Return",":","float",":","precision","at","k","(","min=0",",","max=1",")"]
code: def precision_at_k(self):
      """Get precision@k.
  
      .. note::
          More details can be found
          `here <http://spark.apache.org/docs/2.1.1/api/python/pyspark.mllib.html#pyspark.mllib.evaluation.RankingMetrics.precisionAt>`_.
  
      Return:
          float: precision at k (min=0, max=1)
      """
      return self._metrics.precisionAt(self.k)
  
imports: import numpy
  from recommenders.utils.constants import DEFAULT_PREDICTION_COL, DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL, DEFAULT_RELEVANCE_COL, DEFAULT_SIMILARITY_COL, DEFAULT_ITEM_FEATURES_COL, DEFAULT_ITEM_SIM_MEASURE, DEFAULT_TIMESTAMP_COL, DEFAULT_K, DEFAULT_THRESHOLD
label_desc: Use image node_id 3 for calling the SparkRankingEvaluation obj's underlying member method code with example usage: obj.precision_at_k() and returns: self