class_docstr: Recommend the most popular items.
  
  The :py:class:`PopScore` class is more flexible, and recommended for new code.
  
  Args:
      selector(CandidateSelector):
          The candidate selector to use. If ``None``, uses a new
          :class:`UnratedItemCandidateSelector`.
  
  Attributes:
      item_pop_(pandas.Series):
          Item rating counts (popularity)
class_docstr_tok: ["Recommend","the","most","popular","items",".","The",":","py",":","class",":","`","PopScore","`","class","is","more","flexible",",","and","recommended","for","new","code",".","Args",":","selector","(","CandidateSelector",")",":","The","candidate","selector","to","use",".","If","``","None","``",",","uses","a","new",":","class",":","`","UnratedItemCandidateSelector","`",".","Attributes",":","item_pop_","(","pandas.Series",")",":","Item","rating","counts","(","popularity",")"]
code: def recommend(self, user, n=None, candidates=None, ratings=None):
      scores = self.item_pop_
      if candidates is None:
          candidates = self.selector.candidates(user, ratings)
  
      idx = scores.index.get_indexer(candidates)
      idx = idx[idx >= 0]
      scores = scores.iloc[idx]
  
      if n is None:
          return scores.sort_values(ascending=False).reset_index()
      else:
          return scores.nlargest(n).reset_index()
  
imports: import logging
  from collections.abc import Iterable, Sequence
  import pandas
  import numpy
  from ..data import sparse_ratings
  from .None import Predictor, Recommender, CandidateSelector
  from ..util import derivable_rng
  from .bias import Bias
  from .ranking import TopN
label_desc: Use image node_id 3 for calling the Popular obj's underlying member method code with example usage: obj.recommend(user, n, candidates, ratings) and returns: scores, scores