class_docstr: User-user nearest-neighbor collaborative filtering with ratings. This user-user implementation
  is not terribly configurable; it hard-codes design decisions found to work well in the previous
  Java-based LensKit code.
  
  Args:
      nnbrs(int):
          the maximum number of neighbors for scoring each item (``None`` for unlimited)
      min_nbrs(int): the minimum number of neighbors for scoring each item
      min_sim(float): minimum similarity threshold for considering a neighbor
      feedback(str):
          Control how feedback should be interpreted.  Specifies defaults for the other
          settings, which can be overridden individually; can be one of the following values:
  
          ``explicit``
              Configure for explicit-feedback mode: use rating values, center ratings, and
              use the ``weighted-average`` aggregate method for prediction.  This is the
              default setting.
  
          ``implicit``
              Configure for implicit-feedback mode: ignore rating values, do not center ratings,
              and use the ``sum`` aggregate method for prediction.
      center(bool):
          whether to normalize (mean-center) rating vectors.  Turn this off when working
          with unary data and other data types that don't respond well to centering.
      aggregate(str):
          the type of aggregation to do. Can be ``weighted-average`` or ``sum``.
      use_ratings(bool):
          whether or not to use rating values; default is ``True``.  If ``False``, it ignores
          rating values and treates every present rating as 1.
  
  Attributes:
      user_index_(pandas.Index): User index.
      item_index_(pandas.Index): Item index.
      user_means_(numpy.ndarray): User mean ratings.
      rating_matrix_(matrix.CSR): Normalized user-item rating matrix.
      transpose_matrix_(matrix.CSR): Transposed un-normalized rating matrix.
class_docstr_tok: ["User-user","nearest-neighbor","collaborative","filtering","with","ratings",".","This","user-user","implementation","is","not","terribly","configurable",";","it","hard-codes","design","decisions","found","to","work","well","in","the","previous","Java-based","LensKit","code",".","Args",":","nnbrs","(","int",")",":","the","maximum","number","of","neighbors","for","scoring","each","item","(","``","None","``","for","unlimited",")","min_nbrs","(","int",")",":","the","minimum","number","of","neighbors","for","scoring","each","item","min_sim","(","float",")",":","minimum","similarity","threshold","for","considering","a","neighbor","feedback","(","str",")",":","Control","how","feedback","should","be","interpreted",".","Specifies","defaults","for","the","other","settings",",","which","can","be","overridden","individually",";","can","be","one","of","the","following","values",":","``","explicit","``","Configure","for","explicit-feedback","mode",":","use","rating","values",",","center","ratings",",","and","use","the","``","weighted-average","``","aggregate","method","for","prediction",".","This","is","the","default","setting",".","``","implicit","``","Configure","for","implicit-feedback","mode",":","ignore","rating","values",",","do","not","center","ratings",",","and","use","the","``","sum","``","aggregate","method","for","prediction",".","center","(","bool",")",":","whether","to","normalize","(","mean-center",")","rating","vectors",".","Turn","this","off","when","working","with","unary","data","and","other","data","types","that","do","n't","respond","well","to","centering",".","aggregate","(","str",")",":","the","type","of","aggregation","to","do",".","Can","be","``","weighted-average","``","or","``","sum","``",".","use_ratings","(","bool",")",":","whether","or","not","to","use","rating","values",";","default","is","``","True","``",".","If","``","False","``",",","it","ignores","rating","values","and","treates","every","present","rating","as","1",".","Attributes",":","user_index_","(","pandas.Index",")",":","User","index",".","item_index_","(","pandas.Index",")",":","Item","index",".","user_means_","(","numpy.ndarray",")",":","User","mean","ratings",".","rating_matrix_","(","matrix.CSR",")",":","Normalized","user-item","rating","matrix",".","transpose_matrix_","(","matrix.CSR",")",":","Transposed","un-normalized","rating","matrix","."]
code: def __init__(
      self, nnbrs, min_nbrs=1, min_sim=0, feedback="explicit", **kwargs
  ):
      self.nnbrs = nnbrs
      self.min_nbrs = min_nbrs
      self.min_sim = min_sim
  
      if feedback == "explicit":
          defaults = {
              "center": True,
              "aggregate": self.AGG_WA,
              "use_ratings": True,
          }
      elif feedback == "implicit":
          defaults = {
              "center": False,
              "aggregate": self.AGG_SUM,
              "use_ratings": False,
          }
      else:
          raise ValueError(f"invalid feedback mode: {feedback}")
  
      defaults.update(kwargs)
      self.center = defaults["center"]
      self.aggregate = intern(defaults["aggregate"])
      self.use_ratings = defaults["use_ratings"]
  
imports: from sys import intern
  import logging
  import pandas
  import numpy
  from numba import njit
  from ..None import util
  from ..data import sparse_ratings
  from .None import Predictor
  from ..util.accum import kvp_minheap_insert
label_desc: Use image node_id 1 to create a new UserUser object from inherited base classes: Predictor with example: obj = UserUser(nnbrs, min_nbrs, min_sim, feedback)