class_docstr: Common predictor for matrix factorization.
  
  Attributes:
      user_index_(pandas.Index): Users in the model (length=:math:`m`).
      item_index_(pandas.Index): Items in the model (length=:math:`n`).
      user_features_(numpy.ndarray): The :math:`m \times k` user-feature matrix.
      item_features_(numpy.ndarray): The :math:`n \times k` item-feature matrix.
class_docstr_tok: ["Common","predictor","for","matrix","factorization",".","Attributes",":","user_index_","(","pandas.Index",")",":","Users","in","the","model","(","length=",":","math",":","`","m","`",")",".","item_index_","(","pandas.Index",")",":","Items","in","the","model","(","length=",":","math",":","`","n","`",")",".","user_features_","(","numpy.ndarray",")",":","The",":","math",":","`","m","\\times","k","`","user-feature","matrix",".","item_features_","(","numpy.ndarray",")",":","The",":","math",":","`","n","\\times","k","`","item-feature","matrix","."]
docstr: Score a set of items for a user. User and item parameters must be indices
  into the matrices.
  
  Args:
      user(int): the user index
      items(array-like of int): the item indices
      raw(bool): if ``True``, do return raw scores without biases added back.
  
  Returns:
      numpy.ndarray: the scores for the items.
docstr_tok: ["Score","a","set","of","items","for","a","user",".","User","and","item","parameters","must","be","indices","into","the","matrices",".","Args",":","user","(","int",")",":","the","user","index","items","(","array-like","of","int",")",":","the","item","indices","raw","(","bool",")",":","if","``","True","``",",","do","return","raw","scores","without","biases","added","back",".","Returns",":","numpy.ndarray",":","the","scores","for","the","items","."]
code: def score(self, user, items, u_features=None):
      """
      Score a set of items for a user. User and item parameters must be indices
      into the matrices.
  
      Args:
          user(int): the user index
          items(array-like of int): the item indices
          raw(bool): if ``True``, do return raw scores without biases added back.
  
      Returns:
          numpy.ndarray: the scores for the items.
      """
  
      # get user vector
      uv = (
          self.user_features_[user, :]
          if u_features is None
          else u_features
      )
      # get item matrix
      im = self.item_features_[items, :]
      rv = np.matmul(im, uv)
      assert rv.shape[0] == len(items)
      assert len(rv.shape) == 1
  
      return rv
  
file_path: lkpy/lenskit/algorithms/mf_common.py
imports: import logging
  import numpy
  import pandas
  from .None import Predictor
label_desc: Use image node_id 6 for calling the MFPredictor obj's underlying member method code with example usage: obj.score(user, items, u_features) and returns: rv