class_docstr: Basic recommender that implements top-N recommendation using a predictor.
  
  .. note::
      This class does not do anything of its own in :meth:`fit`.  If its
      predictor and candidate selector are both fit separately, the top-N recommender
      does not need to be fit.  This can be useful when reusing a predictor in other
      contexts::
  
          pred = item_knn.ItemItem(20, feedback='implicit')
          select = UnratedItemCandidateSelector()
          topn = TopN(pred, select)
  
          pred.fit(ratings)
          select.fit(ratings)
          # topn.fit is unnecessary now
  
  Args:
      predictor(Predictor):
          The underlying predictor.
      selector(CandidateSelector):
          The candidate selector.  If ``None``, uses
          :class:`UnratedItemCandidateSelector`.
class_docstr_tok: ["Basic","recommender","that","implements","top-N","recommendation","using","a","predictor",".","..","note",":",":","This","class","does","not","do","anything","of","its","own","in",":","meth",":","`","fit","`",".","If","its","predictor","and","candidate","selector","are","both","fit","separately",",","the","top-N","recommender","does","not","need","to","be","fit",".","This","can","be","useful","when","reusing","a","predictor","in","other","contexts",":",":","pred","=","item_knn.ItemItem","(","20",",","feedback='implicit","'",")","select","=","UnratedItemCandidateSelector","(",")","topn","=","TopN","(","pred",",","select",")","pred.fit","(","ratings",")","select.fit","(","ratings",")","#","topn.fit","is","unnecessary","now","Args",":","predictor","(","Predictor",")",":","The","underlying","predictor",".","selector","(","CandidateSelector",")",":","The","candidate","selector",".","If","``","None","``",",","uses",":","class",":","`","UnratedItemCandidateSelector","`","."]
code: def __init__(self, predictor, selector=None):
      from .basic import UnratedItemCandidateSelector
  
      self.predictor = predictor
      self.selector = (
          selector
          if selector is not None
          else UnratedItemCandidateSelector()
      )
  
file_path: lkpy/lenskit/algorithms/ranking.py
imports: import logging
  import numpy
  from .None import Recommender, Predictor
  from ..util import derivable_rng
label_desc: Use image node_id 1 to create a new TopN object from inherited base classes: Recommender, Predictor with example: obj = TopN(predictor, selector)